oracle里函数translate的用法
时间:2010-09-08 来源:dbconf
translate的主要作用是提取,替换字符串,其作用有时候和replace差不多.具体看下面的例子
select translate('liyan4h123ui','#liyanhui','#') from dual
结果:4123
select translate('asadad434323', '#0123456789','#') from dual
结果:asadad
select TRANSLATE('kkaxksx', 'kx', '12') from dual
结果:11a21s2
select * from (
select a2,count(*) from A1 group by a1,
select a2,count(*) from A2 group by a2,
select a3,count(*) from A3 group by a3,
) order by 2 //2 在这里的意思是按照第二列的值排序
select translate('liyan4h123ui','#liyanhui','#') from dual
结果:4123
select translate('asadad434323', '#0123456789','#') from dual
结果:asadad
select TRANSLATE('kkaxksx', 'kx', '12') from dual
结果:11a21s2
select * from (
select a2,count(*) from A1 group by a1,
select a2,count(*) from A2 group by a2,
select a3,count(*) from A3 group by a3,
) order by 2 //2 在这里的意思是按照第二列的值排序
相关阅读 更多 +