日期:2014-05-17 浏览次数:20636 次
select CheckInTime,sum(case when b.mingcheng='北京' then a.renshu else 0 end) '北京',sum(case when b.mingcheng='上海' then a.renshu else 0 end) '上海',sum(case when b.mingcheng='杭州' then a.renshu else 0 end) '杭州' from Tbl_checkIn a,tbl_PiaoLei b where a.piaolei=b.bianhao and CheckInTime>= '2012-10-01' and CheckInTime<= '2012-10-07' and CheckInNo='01' GROUP BY CheckInTime