一年的时间过去了,日志却没有更新多少,哎,还是太懒了...言归正传,在使用oracle写sql脚本时会有一些特殊写法来实现查询。去除对称数据select tab.g from (
with a as ( select a.id || b.id g,a.rowid arowid,b.rowid browid
from test_dk a,test_dk b )
select g,a.arowid,a.browid from a
) tab
where tab.arowid < tab.browid
order by rownum desc行转列,列转行select wm_concat(v.id) id from (
with a as ( select '1,2,3,4,' id from dual )
select regexp_substr(id,'[^,]+',1,rownum) id from a
connect by rownum <= length(regexp_replace(id,'[^,]+'))
) v
oracle 递归调用sele
技术·学习
· 2018-01-17
· 474 人浏览
小残曦