当前位置:网站首页>SqlServer行转列PIVOT
SqlServer行转列PIVOT
2022-07-03 02:39:00 【鏗木鏘林】
现有原始数据表:SELECT * FROM FIX_0528_ADD

需要将FMONTH字段行转成列,汇总FADD数量:
SELECT FNAME,[2022-01],[2022-02],[2022-03],[2022-04]
FROM FIX_0528_ADD
PIVOT(SUM(FADD) FOR FMONTH IN ([2022-01],[2022-02],[2022-03],[2022-04])) T执行后结果:

边栏推荐
猜你喜欢

错误Invalid bound statement (not found): com.ruoyi.stock.mapper.StockDetailMapper.xxxx解决

HTB-Devel

Basic operation of binary tree (C language version)

MATLAB小技巧(24)RBF,GRNN,PNN-神经网络

Summary of interview project technology stack

HTB-Devel

HW-初始准备
![[Hcia]No.15 Vlan间通信](/img/59/a467c5920cbccb72040f39f719d701.jpg)
[Hcia]No.15 Vlan间通信
【ROS进阶篇】第六讲 ROS中的录制与回放(rosbag)

Oauth2.0 authentication, login and access "/oauth/token", how to get the value of request header authorization (basictoken)???
随机推荐
GBase 8c系统表-pg_am
Gbase 8C trigger (III)
Principle and application of database
Interview stereotyped version
javeScript 0.1 + 0.2 == 0.3的问题
Awk from getting started to being buried (2) understand the built-in variables and the use of variables in awk
【ROS进阶篇】第六讲 ROS中的录制与回放(rosbag)
内存池(内核角度理解new开辟空间的过程)
Cancer biopsy instruments and kits - market status and future development trends
4. Classes and objects
awk从入门到入土(2)认识awk内置变量和变量的使用
SQL server queries the table structure of the specified table
[shutter] bottom navigation bar page frame (bottomnavigationbar bottom navigation bar | pageview sliding page | bottom navigation and sliding page associated operation)
【翻译】Flux安全。通过模糊处理获得更多信心
HW initial preparation
Gbase 8C system table PG_ attribute
easyExcel
Restcloud ETL cross database data aggregation operation
What does "where 1=1" mean
Gbase 8C system table PG_ authid