日期:2014-05-17 浏览次数:20564 次
select ReportDate,TagName,
max(case RangeID when 1 then LastTime_TotalSeconds else 0 end) as 1,
max(case RangeID when 2 then LastTime_TotalSeconds else 0 end) as 2,
max(case RangeID when 3 then LastTime_TotalSeconds else 0 end) as 3,
.
.
.
from tb
group by TagName,ReportDate