日期:2014-05-18 浏览次数:20616 次
ID CodeID Feedback SetpID 1 188 test 1 2 188 test1 1 3 188 test2 1 4 188 test3 1 5 188 test4 2 6 188 test5 2 7 188 test6 2 8 188 test7 3 9 188 test8 3 10 200 test11 1 11 200 test12 1 12 200 test34 2 13 200 test35 2 14 200 test36 2
code setp1 setp2 setp3 setp4 setp5 setp6 setp7 setp8 setp9 188 4 3 2 200 2 3
select CodeID,sum(case when SetpID = 1 then 1 else 0 end) Setp1, sum(case when SetpID = 2 then 1 else 0 end) Setp2, ...... from Table