这是一个例子
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)
);
我的问题是,如果NOT EXISTS
只是返回TRUE
or FALSE
,如何SELECT distinct R1.A
知道要返回哪些值?
例如这个 jsfiddle
如果存在 number = 5,则此查询将在 numbers 列中返回 EVERYTHING