Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我必须表格mdl1并且mdl2 两者都具有相同的属性(列)。
mdl1
mdl2
我想获取表ps_stud_id中不存在的所有值mdl2。
ps_stud_id
select ps_stud_id from mdl1 where ps_stud_id not in ( select ps_stud_id from mdl2 )
或者
select mdl1.ps_stud_id from mdl1 left outer join mdl2 on mdl1.ps_stud_id = mdl2.ps_stud_id where mdl2.ps_stud_id is null