当前位置:网站首页>oracle 多行数据合并成一行数据
oracle 多行数据合并成一行数据
2022-07-05 09:29:00 【相思子~】
前言
划水的时候看到有人问了这个问题,顺手写个sql记录一下。
原sql数据(多行)
select null as v1_name, 1 as v1, '名称2' as v2_name, 2 as v2
from dual
union all
select '名称3' as v1_name, 3 as v1, '名称4' as v2_name, 4 as v2
from dual
合并后
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, '名称2' as v2_name, 2 as v2
from dual
union all
select '名称3' as v1_name, 3 as v1, '名称4' as v2_name, 4 as v2
from dual) a
边栏推荐
- [how to disable El table]
- 如何正确的评测视频画质
- 【两个对象合并成一个对象】
- 【数组的中的某个属性的监听】
- LeetCode 31. 下一个排列
- Vs code problem: the length of long lines can be configured through "editor.maxtokenizationlinelength"
- Uni app implements global variables
- Develop and implement movie recommendation applet based on wechat cloud
- 【阅读笔记】图对比学习 GNN+CL
- Kotlin introductory notes (I) kotlin variables and non variables
猜你喜欢
[sourcetree configure SSH and use]
Develop and implement movie recommendation applet based on wechat cloud
植物大战僵尸Scratch
22-07-04 Xi'an Shanghao housing project experience summary (01)
Kotlin introductory notes (II) a brief introduction to kotlin functions
Kotlin introductory notes (VIII) collection and traversal
Community group buying has triggered heated discussion. How does this model work?
What should we pay attention to when entering the community e-commerce business?
Global configuration tabbar
【阅读笔记】图对比学习 GNN+CL
随机推荐
阿里十年测试带你走进APP测试的世界
顶会论文看图对比学习(GNN+CL)研究趋势
LeetCode 556. Next bigger element III
SQL learning alter add new field
Kotlin introductory notes (V) classes and objects, inheritance, constructors
【对象数组的排序】
小程序启动性能优化实践
H.265编码原理入门
The popularity of B2B2C continues to rise. What are the benefits of enterprises doing multi-user mall system?
[hungry dynamic table]
如何正确的评测视频画质
The research trend of map based comparative learning (gnn+cl) in the top paper
一文读懂TDengine的窗口查询功能
Hi Fun Summer, play SQL planner with starrocks!
First understanding of structure
Can't find the activitymainbinding class? The pit I stepped on when I just learned databinding
22-07-04 Xi'an Shanghao housing project experience summary (01)
Kotlin introductory notes (VI) interface and function visibility modifiers
Unity skframework framework (XXIII), minimap small map tool
【阅读笔记】图对比学习 GNN+CL