【发布时间】:2014-08-20 14:02:43
【问题描述】:
我在项目上遇到了一些麻烦。 我有 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')
真的很着急,因为有人在逗我。
【问题讨论】: