Sql行列转换参考
行列转换:
SELECT
max(case type when 0 then jine else 0 end) a,
max(case type when 1 then jine else 0 end) b,
max(case type when 2 then jine else 0 end) c
FROM Table WHERE tuanid='402881e44365c0dc014366a4b47e0114'
group by tuanid
行列转换:
SELECT
max(case type when 0 then jine else 0 end) a,
max(case type when 1 then jine else 0 end) b,
max(case type when 2 then jine else 0 end) c
FROM Table WHERE tuanid='402881e44365c0dc014366a4b47e0114'
group by tuanid