sql pivot 多值, oracle pivot 行转列多个字段
-- 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
本文可执行sql文件
https://files.cnblogs.com/files/chenghu/行列转换.rar?t=1681464884