因为MySQL5.0以前不支持子查询(5.0以后也没试过),所以MySQL下这样写: select b.* from testb b left join test a on b.aid=a.id where a.name is null
select * from b left join a on b.aid = a.id
select * from B表 where aid not in(select id from A表)
MySQL: select b.* from testb b left join test a on b.aid=a.id where a.name is null MSSQL: select * from B where aid not in (select id from A)我特意装MySQL试了的,加分吧!
mysql: select B.* from B left join A on B.aid=A.id where A.name is null; 小弟试过了!
select b.* from testb b left join test a on b.aid=a.id where a.name is null
MSSQL: select * from B where aid not in (select id from A)我特意装MySQL试了的,加分吧!
小弟试过了!