日期:2014-05-18  浏览次数:20660 次

链接两个table


能不能根据以上的两个table 来连接显示以下的成绩



------解决方案--------------------
SQL code
select 
a.shiftid,a.[count],
sum(case when b.system like 'cimpack%' then job else 0 end) as cimpack,
sum(case when b.system like 'floortrack%' then job else 0 end) as floortrack
from t1 inner joint t2 on t1.shiftid=b.shiftid
group by a.shiftid,a.[count]