oracle取数字,替换字符,查询树形结构,(+)
来源:互联网 发布:mac重置管理员账户 编辑:程序博客网 时间:2024/06/06 13:08
select regexp_substr('ED2WCSID_PH_20110324.txt','[0-9]+',5) from dual
结果:20110324
select regexp_substr('EDWCSID_PH_20110324.txt','[0-9]+') from dual
结果:20110324
1 case when
select distinct t.RPTID as rid,t.start_year as 起始年 ,t.start_month as 起始月 ,t.end_year as 截至年 , t.end_month
as 截至月,
( CASE WHEN t.reporttype = 'month' THEN '月报'
ELSE '年报'
END
)as 报表类型 ,( CASE WHEN t.reporthome = 'gf' THEN '股份'
ELSE '集团'
END
) as 报表归属, t.operationname as 修改人,t.operationtime as 修改日期 ,v.rvVersion as 版本
from REPORT_RATE t join RPTVERSION v on t.RPTVID=v.RVID left join reportinfo r on t.rptcode=r.rptcode order by t.rptid
2 decode
select distinct t.RPTID as rid,t.start_year as 起始年 ,t.start_month as 起始月 ,t.end_year as 截至年 , t.end_month
as 截至月,
( CASE WHEN t.reporttype = 'month' THEN '月报'
ELSE '年报'
END
)as 报表类型 ,( CASE WHEN t.reporthome = 'gf' THEN '股份'
ELSE '集团'
END
) as 报表归属, t.operationname as 修改人,t.operationtime as 修改日期 ,v.rvVersion as 版本
,decode(t.reporthome,'gf','股份','jt','集团','其他')
from REPORT_RATE t join RPTVERSION v on t.RPTVID=v.RVID left join reportinfo r on t.rptcode=r.rptcode order by t.rptid
3 repalce
select
replace(replace(t.reporthome,'jt','集团'),'gf','股份')
from report_rate t
as 截至月,
( CASE WHEN t.reporttype = 'month' THEN '月报'
ELSE '年报'
END
)as 报表类型 ,( CASE WHEN t.reporthome = 'gf' THEN '股份'
ELSE '集团'
END
) as 报表归属, t.operationname as 修改人,t.operationtime as 修改日期 ,v.rvVersion as 版本
from REPORT_RATE t join RPTVERSION v on t.RPTVID=v.RVID left join reportinfo r on t.rptcode=r.rptcode order by t.rptid
2 decode
select distinct t.RPTID as rid,t.start_year as 起始年 ,t.start_month as 起始月 ,t.end_year as 截至年 , t.end_month
as 截至月,
( CASE WHEN t.reporttype = 'month' THEN '月报'
ELSE '年报'
END
)as 报表类型 ,( CASE WHEN t.reporthome = 'gf' THEN '股份'
ELSE '集团'
END
) as 报表归属, t.operationname as 修改人,t.operationtime as 修改日期 ,v.rvVersion as 版本
,decode(t.reporthome,'gf','股份','jt','集团','其他')
from REPORT_RATE t join RPTVERSION v on t.RPTVID=v.RVID left join reportinfo r on t.rptcode=r.rptcode order by t.rptid
3 repalce
select
replace(replace(t.reporthome,'jt','集团'),'gf','股份')
from report_rate t
start with ONNECT BY PRIOR
1,
select t.ciid ,t.cicode,t.ciscode,t.ciname name,t.cispcode parentId,T.CORBELONG,
p.ciscode pscode,p.ciname pname,t.ciname
from corinfo t,(select * from corinfo ci where ci.civalid='1') p
where 1=1 and t.cispcode = p.cicode(+) AND T.CORBELONG ='gf'
and t.ciscode not like 'T%' and t.ciscode not like 'UT%' and t.ciscode not like 'LD%' and t.ciscode not like 'HW%'
order by t.ciscode desc ,
p.ciscode pscode,p.ciname pname,t.ciname
from corinfo t,(select * from corinfo ci where ci.civalid='1') p
where 1=1 and t.cispcode = p.cicode(+) AND T.CORBELONG ='gf'
and t.ciscode not like 'T%' and t.ciscode not like 'UT%' and t.ciscode not like 'LD%' and t.ciscode not like 'HW%'
order by t.ciscode desc ,
2,
select t.ciid ,t.cicode,t.ciscode, t.ciname name,T.cispcode parentId, p.ciscode pscode,p.ciname pname ,t.cilevel,b.cbfolder,t.ciname
from corinfo t,corboe b,(select * from corinfo ci where ci.civalid='1') p
where 1=1 and t.civalid = '1' and
t.CIID = b.CIID and b.CBVALID = 1 and t.cispcode = p.cicode(+)
and t.rvid is not null
AND T.CORBELONG ='gf'
and t.ciscode not like 'T%' and t.ciscode not like 'UT%' and t.ciscode not like 'LD%' and t.ciscode not like 'HW%'
start with t.cispcode = 0 CONNECT BY PRIOR t.cicode = t.cispcode ORDER BY t.ciname asc
from corinfo t,corboe b,(select * from corinfo ci where ci.civalid='1') p
where 1=1 and t.civalid = '1' and
t.CIID = b.CIID and b.CBVALID = 1 and t.cispcode = p.cicode(+)
and t.rvid is not null
AND T.CORBELONG ='gf'
and t.ciscode not like 'T%' and t.ciscode not like 'UT%' and t.ciscode not like 'LD%' and t.ciscode not like 'HW%'
start with t.cispcode = 0 CONNECT BY PRIOR t.cicode = t.cispcode ORDER BY t.ciname asc
0 0
- oracle取数字,替换字符,查询树形结构,(+)
- Oracle树形结构查询
- ORACLE树形结构查询
- oracle树形结构查询
- Oracle树形结构查询
- Oracle查询树形结构
- Oracle树形结构查询
- Oracle查询树形结构
- Oracle查询树形结构
- oracle 树形结构查询
- /*Oracle树形结构查询*/
- Oracle树形结构实行查询
- Oracle 数据库树形结构查询
- oracle树形结构实行查询
- oracle树形结构查询语句
- Oracle树形结构实行查询
- Oracle SQL树形结构查询
- Oracle层级(树形结构)查询及优化
- 【杭电1257】最少拦截系统(LIS)基础
- DataGrid嵌套在handler方法中获取当前的DataGrid
- 04.格式化输入输出
- jquery radio 没选中,点击后,选中;选中后,点击,不再选中;
- DDL,DML,DCL,TCL四种语言的简介
- oracle取数字,替换字符,查询树形结构,(+)
- java String运算符+反编译
- HTML 拖拽效果
- 1912: 小火山的爱情密码 (尺取比二分果然更有优势)
- POJ 1769 Minimizing maximizer
- 总结系列-LayoutInflater的inflate函数用法详解
- 分布式任务调度中间件SchedulerX
- Cocos2d-x的学习 触碰事件老版本和新版本的对比 第二节
- Android实现通过浏览器点击链接打开本地应用(APP)并拿到浏览器传递的数据