clwn.net
当前位置:首页 >> orAClE wm ConCAt去重 >>

orAClE wm ConCAt去重

wm_concat 的求和中对数据项的排序方式比较复杂,取数据是楼主你这种方式,其实只差最后一步了。 select max(a.var) var from (select wm_concat(t.id) over(order by to_number(t.id)) var from student t) a

SELECT RTRIM(XMLAGG(XMLPARSE(CONTENT 字段a || ',' WELLFORMED)) .GETCLOBVAL(), ',')FROM 表;

delete from 表名 where rowid not in( select min(rowid) from 表名 group by listagge)

方法一,使用connect by +sys_connect_by_path : --测试数据 create table test(col varchar2(10)); insert into test values('a'); insert into test values('b'); insert into test values('c'); --SQL语句: select ltrim(sys_connect_by_path(...

一般是自己写函数重载这个方法,百度方法很有多 create or replace TYPE zh_concat_im AUTHID CURRENT_USER AS OBJECT( CURR_STR clob, STATIC FUNCTION ODCIAGGREGATEINITIALIZE(SCTX IN OUT zh_concat_im) RETURN NUMBER, MEMBER FUNCTION ODC...

insert into test values('aaa','1');insert into test values('bbb','2');insert into test values('ccc','5');insert into test values('ddd','3');select wm_concat(a),wm_concat(b) from test; WM_CONCAT(A) WM_CONCAT(B)1 aaa,bbb,ccc,ddd ...

select wm_concat(a.NAME) from( select a.id as aid,a.NAME from A a,B b start with a.ID=b.ID connect by prior a.PID=a.ID order by a.id asc ) a 试试这个。

SELECT x.rc_id,wmsys.wm_concat(x.project_name) as project_name FROM( SELECT distinct t.rc_id, t.project_name FROM required_collect_detail t where t.rc_id=rc_id ) x group by x.rc_id

SYS_CONNECT_BY_PATH .... START WITH .... CONNECT BY 这个应该可以

建库时的个选项需要安装,如果没有安装就没有这个函数,也可以不用安装,自己构建一个这样的函数,网上搜索一下 http://zjm16.iteye.com/blog/899941 这个可以用,我试过

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