I am facing some issues retrieving data using SQL in one specific scenario:
Suppose I have the following tables:
A
(id, attr_a, attr_b);B
(id, attr_d, attr_e);C
(id_a, id_b);
As you can see, table C
have FK
referencing id from table A
, and referencing id from table C
.
I need to retrieve table A
rows that for each A
row relates to every B
row.
In a real life scenario, assuming A
means users, B
means privileges, and C
is the many to many entity that relates users with privileges, I would want to get only users that have ALL privileges