当前位置:网站首页>oracle 分组合并字段,每组行显示
oracle 分组合并字段,每组行显示
2022-08-03 17:31:00 【System.out.print】
效果:

实现:采用wm_concat()函数
select dateStr,wm_concat(userName) from
(
SELECT l.dateStr,u.userName,
row_number() over(partition by l.dateStr order by l.dateStr asc) su
FROM userLog l, user u
WHERE l.userId = u.id
and l.operation = 'login'
)
GROUP BY dateStr说明:
1、wm_concat()函数默认,号分割。若要用其它分隔符,可以如下使用
replace(wm_ concat(userName),',','、');
2、 row_number() over(partition by l.dateStr order by l.dateStr asc) su 这句sql是分组排序
边栏推荐
- 使用o.execute_sql 查询很很很小的表, 要7/8秒钟, 这个怎么解决
- 分享 14 个你必须知道的 JS 函数
- 【engine】RtcSyncCallback回调、回调容器RtcCallbackContainer及MediaPacketSenderImpl 中回调使用
- TiKV & TiFlash 加速复杂业务查询丨TiFlash 应用实践
- 【机器学习】机器学习基本概念/术语3
- SkyWalking概要介绍
- 新“妖股”13个交易日暴涨320倍,市值3100亿美元超阿里
- 论文解读(JKnet)《Representation Learning on Graphs with Jumping Knowledge Networks》
- 303. Range Sum Query - Immutable
- 融云「音视频架构实践」技术专场【内含完整PPT】
猜你喜欢
随机推荐
341. Flatten Nested List Iterator
303. Range Sum Query - Immutable
Web3的开源为何会如此受到人们喜爱?
沃尔沃:这是会“种草”的“安全感”!
The strongest distributed lock tool: Redisson
CC2530_ZigBee+华为云IOT:设计一套属于自己的冷链采集系统
【时间的比较】
A complete detailed tutorial on building intranet penetration ngrok (with pictures and truth)
5. Longest Palindromic Substring
阿里二面:没有 accept,能建立 TCP 连接吗?
phoenix创建映射表和创建索引、删除索引
Interpretation of the paper (JKnet) "Representation Learning on Graphs with Jumping Knowledge Networks"
一些嵌入式软件设计经验
并查集模板及思想
isNotBlank与isNotEmpty
Interviews are no longer hanged!This is the correct way to open the seven schemes of Redis distributed locks
JSON.stringify()的深入学习和理解
面试突击:什么是粘包和半包?怎么解决?
【Metaverse系列一】元宇宙的奥秘
一键进入华为云会议,长期免费值得所有开发团队有一套【华为云至简致远】









