当前位置:网站首页>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
边栏推荐
- [2021] Spatio-Temporal Graph Contrastive Learning
- Using MySQL with Oracle
- 机器学习---线性回归
- 和谐宿舍(线性dp / 区间dp)
- js 判斷數字字符串中是否含有字符
- [database] MySQL single table query
- Informatics Olympiad 1955: [11noip popularization group] Swiss round | openjudge 4.1 4363: Swiss round | Luogu p1309 [noip2011 popularization group] Swiss round
- Leetcode 1547: minimum cost of cutting sticks
- A trinomial expression that causes a null pointer
- 2022/4/22
猜你喜欢
AQS source code reading
View, modify and delete [database] table
[WinUI3]编写一个仿Explorer文件管理器
MySQL slow query
[database] MySQL basic operation (basic operation ~)
Uglifyjs compress JS
多线程基本概念(并发与并行、线程与进程)和入门案例
Download PDF from HowNet (I don't want to use CAJViewer anymore!!!)
Define defines constants and macros, pointers and structures
CLion+OpenCV identify ID number - detect ID number
随机推荐
Deep learning notes - fine tuning
深度学习笔记 —— 数据增广
TypeError: ‘Collection‘ object is not callable. If you meant to call the ......
Innovation training (10)
redis和mysql区别
Backup MySQL database with Navicat
Sword finger offer: the path with a certain value in the binary tree (backtracking)
redis数据类型有哪些
Sword finger offer: symmetric binary tree (recursive iteration leetcode 101)
Innovation training (V) mid term inspection
CLion+OpenCV identify ID number - detect ID number
Unity C e-learning (IV)
机器学习---线性回归
Define defines constants and macros, pointers and structures
和谐宿舍(线性dp / 区间dp)
Barcode generation and decoding, QR code generation and decoding
Informatics Olympiad 1955: [11noip popularization group] Swiss round | openjudge 4.1 4363: Swiss round | Luogu p1309 [noip2011 popularization group] Swiss round
JS détermine si la chaîne de nombres contient des caractères
The 2021 more reading report was released, and the book consumption potential of post-95 and Post-00 rose
Knowledge points sorting: ES6