我在项目上遇到了一些麻烦。 我有1个mysql查询句子。 我需要将它从mysql更改为oracle。 查询如下,
select substring(ad_cde,1,18)
from advertise
where substring(ad_cde,1,18)='119821168010300222'
insert into advertise(ad_cde)
select concat('119821168010300000',lpad(convert(substring(max(ad_cde),19,3),unsigned)+1,3,'0')) as a
from advertise
where substring(ad_cde,1,18)='119821168010300000'
and EXISTS(select * from advertise where substring(ad_cde,1,18)='119821168010300000')
insert into advertise(ad_cde)
select concat('119821168010300101',lpad(convert(substring(max(ad_cde),19,3),unsigned)+1,3,'0')) as a
from advertise
where NOT EXISTS(select * from advertise where substring(ad_cde,1,18)='119821168010300101')
它真的很着急,因为有人在戏弄我。
答案 0 :(得分:0)
替换' mysql'功能与' plsql'功能 substring with substr 与||结合你想要连接什么之间 如果转换是将类型更改为数字,请将其替换为to_number