当前位置:网站首页>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
边栏推荐
- 【对象数组的排序】
- What about wechat mall? 5 tips to clear your mind
- H.265编码原理入门
- 22-07-04 Xi'an Shanghao housing project experience summary (01)
- uni-app---uni. Navigateto jump parameter use
- MYSQL 对字符串类型排序不生效问题
- Viewpager pageradapter notifydatasetchanged invalid problem
- Android privacy sandbox developer preview 3: privacy, security and personalized experience
- Uni app implements global variables
- 【js 根据对象数组中的属性进行排序】
猜你喜欢
E-commerce apps are becoming more and more popular. What are the advantages of being an app?
Kotlin introductory notes (II) a brief introduction to kotlin functions
SMT32H7系列DMA和DMAMUX的一点理解
Go 语言使用 MySQL 的常见故障分析和应对方法
Applet data attribute method
Shutter uses overlay to realize global pop-up
Applet customization component
一篇文章带你走进cookie,session,Token的世界
Composition of applet code
LeetCode 496. 下一个更大元素 I
随机推荐
一文详解图对比学习(GNN+CL)的一般流程和最新研究趋势
[team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details
Wxml template syntax
MySQL installation configuration and creation of databases and tables
百度APP 基于Pipeline as Code的持续集成实践
顶会论文看图对比学习(GNN+CL)研究趋势
Composition of applet code
LeetCode 496. Next larger element I
Three-level distribution is becoming more and more popular. How should businesses choose the appropriate three-level distribution system?
22-07-04 Xi'an Shanghao housing project experience summary (01)
[sorting of object array]
干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
一次 Keepalived 高可用的事故,让我重学了一遍它
Hosting environment API
H.265编码原理入门
[Yugong series] go teaching course 003-ide installation and basic use in July 2022
【技术直播】如何用 VSCode 从 0 到 1 改写 TDengine 代码
Alibaba's ten-year test brings you into the world of APP testing
Progressive JPEG pictures and related
Node の MongoDB Driver