select * from students1;

students1.name  students1.age   students1.gpa
fred    35  1.28
barney  32  2.32
shyam   32  2.32

select * from students2;
students1.name  students1.age
fred    35
barney  32

当我运行此查询时
select
name,age from students1
where not exists
(select name,age from students2);

我收到以下波纹错误

最佳答案

错误消息是明确的。使用exists / not exists时,应该使子查询相关。

select name,age
from students1 s1
where not exists (select 1
                  from students2 s2
                  where s1.name=s2.name and s1.age=s2.age
                 )

关于hadoop - 配置单元中的错误:对于存在/不存在运算符,子查询必须是相关的,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51767158/

10-10 20:21