一个简单sql问题 下班结帖.
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