当前位置:网站首页>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是分组排序
边栏推荐
- SwinIR combat: record the training process of SwinIR in detail
- leetcode-每日一题899. 有序队列(思维题)
- 酷开科技 × StarRocks:统一 OLAP 分析引擎,全面打造数字化的 OTT 模式
- 003_Kubernetes核心技术
- 并查集模板及思想
- 大型企业数据治理的现状和解决方案有哪些参考?_光点科技
- 一些嵌入式软件设计经验
- Interviews are no longer hanged!This is the correct way to open the seven schemes of Redis distributed locks
- ATM银行系统(对象初级练习)
- 通用型安全监测数据管理系统
猜你喜欢
随机推荐
PTA递归练习
【机器学习】机器学习基本概念/术语3
J9货币论:数字经济为全球经济复苏注入力量
云图说丨初识华为云微服务引擎CSE
FinClip | July 2022 Product Highlights
EasyExcel implements dynamic column parsing and table storage
ICDAR competition technology sharing
Halcon 小笔记 C# 图片是否有效
CC2530_ZigBee+华为云IOT:设计一套属于自己的冷链采集系统
【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(十一)
Interpretation of the paper (JKnet) "Representation Learning on Graphs with Jumping Knowledge Networks"
微信小程序 - 数组 push / unshift 追加后数组返回内容为数字(数组添加后打印结果为 Number 数值类型)
Web3 security risks daunting?How should we respond?
sibling component communication context
CC2530_ZigBee+HUAWEI CLOUD IOT: Design your own cold chain acquisition system
每周推荐短视频:为了填补学习资源的空缺,作者专门写了本书?
SkyWalking概要介绍
星巴克输血赶不上流血
【时间的比较】
出海,是泡泡玛特的“解药”吗?