Here is an example
T(A) = RENTED(A,C) / BOATS(C)
select distinct R1.A from RENTED R1
where not exists
(select * from SAILBOAT S
where not exists
(select * from RENTED R2
where R1.A = R2.A
and R2.C = S.C)
);
My question is, if NOT EXISTS
just returns TRUE
or FALSE
, how does SELECT distinct R1.A
know which values to return?
For example this jsfiddle
This query returns EVERYTHING in the numbers column if there exists a number = 5