当前位置:网站首页>Oracle combines multiple rows of data into one row of data
Oracle combines multiple rows of data into one row of data
2022-07-05 09:41:00 【Acacia seed~】
Preface
When I was paddling, I saw someone ask this question , Write a handy sql Make a note of .
primary sql data ( Multiple lines )
select null as v1_name, 1 as v1, ' name 2' as v2_name, 2 as v2
from dual
union all
select ' name 3' as v1_name, 3 as v1, ' name 4' as v2_name, 4 as v2
from dual

After the merger
select (wm_concat(a.v1_name)) as v1_name,
(wm_concat(a.v1)) as v1,
(wm_concat(a.v2_name)) as v2_name,
(wm_concat(a.v2)) as v2
from (select null as v1_name, 1 as v1, ' name 2' as v2_name, 2 as v2
from dual
union all
select ' name 3' as v1_name, 3 as v1, ' name 4' as v2_name, 4 as v2
from dual) a

边栏推荐
- Applet network data request
- 顶会论文看图对比学习(GNN+CL)研究趋势
- Resolve the horizontal (vertical) sliding conflict between viewpager and WebView
- Why does everyone want to do e-commerce? How much do you know about the advantages of online shopping malls?
- Viewpager pageradapter notifydatasetchanged invalid problem
- C # compare the differences between the two images
- TDengine ×英特尔边缘洞见软件包 加速传统行业的数字化转型
- MYSQL 对字符串类型排序不生效问题
- 百度智能小程序巡检调度方案演进之路
- C form click event did not respond
猜你喜欢
随机推荐
Node の MongoDB Driver
Node collaboration and publishing
MySQL does not take effect in sorting string types
Vs code problem: the length of long lines can be configured through "editor.maxtokenizationlinelength"
Unity skframework framework (XXII), runtime console runtime debugging tool
SMT32H7系列DMA和DMAMUX的一点理解
Priority queue (heap)
[ManageEngine] how to make good use of the report function of OpManager
【技术直播】如何用 VSCode 从 0 到 1 改写 TDengine 代码
[sourcetree configure SSH and use]
How to empty uploaded attachments with components encapsulated by El upload
C语言-从键盘输入数组二维数组a,将a中3×5矩阵中第3列的元素左移到第0列,第3列以后的每列元素行依次左移,原来左边的各列依次绕到右边
为什么不建议你用 MongoDB 这类产品替代时序数据库?
Unity SKFramework框架(二十三)、MiniMap 小地图工具
NIPS2021 | 超越GraphCL,GNN+对比学习的节点分类新SOTA
Applet data attribute method
High performance spark_ Transformation performance
C language - input array two-dimensional array a from the keyboard, and put 3 in a × 5. The elements in the third column of the matrix are moved to the left to the 0 column, and the element rows in ea
Kotlin introductory notes (VII) data class and singleton class
【阅读笔记】图对比学习 GNN+CL









