当前位置:网站首页>MySQL realizes row to column SQL
MySQL realizes row to column SQL
2022-04-23 05:03:00 【Great Wall ol】
A way to transfer rows to columns , according to property Value of field a,b Convert to different columns , for example A,B Two
SELECT date,
sum(CASE property WHEN 'a' THEN value ELSE 0 END) as 'A',
sum(CASE property WHEN 'b' THEN value ELSE 0 END) as 'B'
FROM `table` where date='2020-03-01' GROUP BY date;
版权声明
本文为[Great Wall ol]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220552270707.html
边栏推荐
- Unity C e-learning (IV)
- [WinUI3]编写一个仿Explorer文件管理器
- redis和mysql区别
- Deep learning notes - fine tuning
- [database] MySQL basic operation (basic operation ~)
- How to exit VIM
- Analysis of POM files
- Cross border e-commerce | Facebook and instagram: which social media is more suitable for you?
- Custom switch control
- Learning Android II from scratch - activity
猜你喜欢
Spell it! Two A-level universities and six B-level universities have abolished master's degree programs in software engineering!
Basic concepts of multithreading (concurrency and parallelism, threads and processes) and entry cases
Innovation training (VI) routing
MySQL -- execution process and principle of a statement
MySQL memo (for your own query)
2022/4/22
View analysis of scenic spots in ArcGIS
深度学习笔记 —— 微调
The 8 diagrams let you see the execution sequence of async / await and promise step by step
Use model load_ state_ Attributeerror appears when dict(): 'STR' object has no attribute 'copy‘
随机推荐
Graduation project
MySQL - index
leetcode——启发式搜索
深度学习笔记 —— 数据增广
Harmonious dormitory (linear DP / interval DP)
List< Map> Replication: light copy and deep copy
Progress of innovation training (III)
QPushbutton 槽函数被多次触发
POI export message list (including pictures)
vscode ipynb文件没有代码高亮和代码补全解决方法
Deep learning notes - object detection and dataset + anchor box
Luogu p2731 horse riding fence repair
[winui3] write an imitation Explorer file manager
Spell it! Two A-level universities and six B-level universities have abolished master's degree programs in software engineering!
Getprop property
mysql5. 7. X data authorization leads to 1141
[winui3] Écrivez une copie du gestionnaire de fichiers Explorer
The 2021 more reading report was released, and the book consumption potential of post-95 and Post-00 rose
Deep learning notes - semantic segmentation and data sets
Use the built-in function of win to transfer files between two computers in the same LAN (the speed is the same as that between local disks)