-- povot 单值
点击查看语句
select * from (
select t_bcr,t_bcrq,t_sjzfje ,t_qs,t_group from lichtest_tb_a
)t1
pivot(min(t_sjzfje) for t_qs in(第一期,第二期,第三期) )p
-- povot 多值
点击查看语句
select * from (
select t_bcr,t_bcrq,t_sjzfje,t_sjzfrq ,t_qs,t_group from lichtest_tb_a
)t1
pivot(max(t_sjzfje),max(t_sjzfrq)as p1 for t_qs in(第一期,第二期,第三期) )p
参考文章
https://blog.csdn.net/qq_32521313/article/details/108519099
http://www.cnblogs.com/SaltFishYe/p/10196083.html
https://blog.csdn.net/qq_40018576/article/details/128287105
标签:qs,https,转列,sjzfje,sql,pivot,select From: https://www.cnblogs.com/chenghu/p/17318461.html本文可执行sql文件
https://files.cnblogs.com/files/chenghu/行列转换.rar?t=1681464884