当前位置:网站首页>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
执行后结果:
边栏推荐
- Gbase 8C system table PG_ aggregate
- Classes and objects - initialization and cleanup of objects - constructor call rules
- leetcode540
- GBase 8c系统表-pg_amop
- [fluent] JSON model conversion (JSON serialization tool | JSON manual serialization | writing dart model classes according to JSON | online automatic conversion of dart classes according to JSON)
- [codeforces] cf1338a - Powered addition [binary]
- 4. 类和对象
- 【翻译】具有集中控制平面的现代应用负载平衡
- Strategy application of Dameng database
- 基于can总线的A2L文件解析(2)
猜你喜欢
4. Classes and objects
sql server数据库添加 mdf数据库文件,遇到的报错
oauth2.0鉴权,登录访问 “/oauth/token”,请求头Authorization(basicToken)如何取值???
Restcloud ETL cross database data aggregation operation
The Linux server needs to install the agent software EPS (agent) database
【ROS进阶篇】第六讲 ROS中的录制与回放(rosbag)
【翻译】后台项目加入了CNCF孵化器
ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc
Random Shuffle attention
[advanced ROS] Lesson 6 recording and playback in ROS (rosbag)
随机推荐
《MATLAB 神经网络43个案例分析》:第43章 神经网络高效编程技巧——基于MATLAB R2012b新版本特性的探讨
二维格式数组格式索引下标连续问题导致 返回json 格式问题
HTB-Devel
GBase 8c系统表-pg_auth_members
easyExcel
[translation] flux is safe. Gain more confidence through fuzzy processing
[Hcia]No.15 Vlan间通信
[shutter] setup of shutter development environment (supplement the latest information | the latest installation tutorial on August 25, 2021)
Hcip137-147 title + analysis
Gbase 8C system table PG_ conversion
GBase 8c系统表-pg_collation
【教程】chrome关闭跨域策略cors、samesite,跨域带上cookie
Build a private cloud disk cloudrev
Gbase 8C system table PG_ auth_ members
4. Classes and objects
cvpr2022去雨去雾
[translation] modern application load balancing with centralized control plane
簡單理解svg
Memory pool (understand the process of new developing space from the perspective of kernel)
Gbase 8C system table PG_ authid