我有3个表如下.
salesman(sid,sname)
location(lid,lname)
sales_loc(sid,lid)
Run Code Online (Sandbox Code Playgroud)
现在我要打印已经访问过所有地点的销售员的sid和sname.我想要一个SQL查询,我不想要PL/SQL代码.
select sid, sname from salesman
where not exists
(select 1 from location
where not exists
(select 1 from sales_loc
where sid=saleman.sid
and lid = location.lid));
Run Code Online (Sandbox Code Playgroud)