主表与子表的其中一条left join

select * from fathertable a

LEFT JOIN childtable d on d.HouseID = a.HouseID and d.MoveInFlag=0 and d.id=(select max(id) from childtable where houseid=a.houseid)

不能把后面的子句写在where中

posted on 2008-11-21 09:26  优雅小猪  阅读(1974)  评论(0编辑  收藏  举报

导航