ddgw.net
当前位置:首页 >> orAClE多行数据合并 >>

orAClE多行数据合并

如果这两行有个共同的其他列作为分组,标志他们是同一组、比如姓名编号之类的,是可以group by后min出来的.select 姓名,min(引流管) as 引流管,min(化疗) as 化疗, min(放疗) as 放疗from 记录表group by 姓名;

oracle数据多行不同列进行合并显示select id ,listagg( name, ',' ) within group ( order by id ) as name from TABLE_NAME GROUP BY id;

select id ,listagg( name, ',' ) within group ( order by id ) as namefrom TABLE_NAMEGROUP BY id;

oracle table函数返回多行数据怎么合并为一行 select id ,listagg( name, ',' ) within group ( order by id ) as namefrom TABLE_NAMEGROUP BY id;

你好!select age, wm_concat(name) name from tableName group by age.仅代表个人观点,不喜勿喷,谢谢.

--取最大 select A,B, max(C) as C,max(D),max(J) as J from 表名 group by A,B--取合计 select A,B, sum(C) as C,sum(D),sum(J) as J from 表名 group by A,B

行转列.select * from ((select tundishno,origin as a1 from 表 where strandid='1') a,(select tundishno,origin as a1 from 表 where strandid='2') b,(select tundishno,origin as a1 from 表 where strandid='3') c,(select tundishno,origin as a1 from 表

单纯的select a||b肯定是错的,你得有个相同的字段才能进行合并啊所以你得把两个表做个子查询加上一个行号,然后用两个行号做关联才行

你好!试试select columnName1, wm_concat(columnName4) from tableNamegroup by columnName1如有疑问,请追问.

declare @t table(name varchar(10), time varchar(20), pay int)insert @tselect 'admin', '2010-01', 5 union allselect 'admin', '2010-02', 90 union allselect 'admin', '2010-03', 45 union allselect 'admin', '2010-04', 45 union allselect 'admin', '2010-05', 45

网站首页 | 网站地图
All rights reserved Powered by www.ddgw.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com