日期:2014-05-18 浏览次数:20523 次
select isnull(a.aid,b.aid) as aid,b.bid from a full join b on a.aid=b.aid
------解决方案--------------------
select * from a inner join b as c on a.AID=c.AID and not exists(select 1 from B where AID=c.AID and BID>c.BID)
------解决方案--------------------
取B表AID相同,最后一條記錄用以上方法
------解决方案--------------------
神马意思?
------解决方案--------------------
--还是 select * from a,b where a.aid=b.aid and bid=(select max(bid) from b t where aid=b.aid)
------解决方案--------------------
select AID,BID from B where exists (select 1 from A where AID=B.AID)
------解决方案--------------------