Oracle 多行分多列
Select * FROM ( Select sprid,RWID,spsj,spyj,sprmc from T_PROJ_DBRW_SPYJ Where sprid In('A','B','C','D') --And RWID in(56295,56186) ) pivot( Max(spsj) spsj,Max(spyj) spyj,Max(sprmc) sprmc For sprid In('A' A,'B' B,'C' C,'D' D) )
https://www.bilibili.com/read/cv25571204/
select a.userid,a.username, level lev, regexp_count(a.REMARK,'[^|]+') as regcou, regexp_substr(a.REMARK,'[^|]+',1,level) as deptid from sys_user_EMPLOYEE a Where a.REMARK Is Not Null connect by prior a.userid = a.userid and prior dbms_random.value is not null and level <= regexp_count(a.REMARK,'[^|]+')
列转行,使用 | 分隔