日期:2014-05-18 浏览次数:20666 次
select distinct a.*,b.LT_TEAMGROUP,c.li_name from TM_ORDER as a inner join LI_TM_CYCLETIME as b on a.TO_TEAM_ID=b.LT_ID LEFT join LI_LINEPRODUCT as c on a.TO_LINE_ID=c.LI_ID order by a.TO_ID desc
select distinct a.*,b.LT_TEAMGROUP,c.li_name from TM_ORDER as a , LI_TM_CYCLETIME as b , LI_LINEPRODUCT as c where a.TO_TEAM_ID=b.LT_ID and a.TO_LINE_ID *= c.LI_ID order by a.TO_ID desc
------解决方案--------------------
你不想用left join,inner join的理由是什么?
------解决方案--------------------
select distinct a.*,b.LT_TEAMGROUP,c.li_name from TM_ORDER a, LI_TM_CYCLETIME b, LI_LINEPRODUCT c where a.TO_TEAM_ID=b.LT_IDon and a.TO_LINE_ID=c.LI_ID order by a.TO_ID desc