日期:2014-05-18 浏览次数:20496 次
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
--楼主是不是想用left join进行联接 select distinct a.*,b.LT_TEAMGROUP,c.li_name from TM_ORDER as a left 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
------解决方案--------------------
--楼主是不是想用left join进行联接 select distinct a.*,b.LT_TEAMGROUP,c.li_name from TM_ORDER as a left 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 left 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 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 where a.column='条件' order by a.TO_ID desc