Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
数据库查询(mysql、oracle)_Mysql_Database_Oracle - Fatal编程技术网

数据库查询(mysql、oracle)

数据库查询(mysql、oracle),mysql,database,oracle,Mysql,Database,Oracle,我在这个项目上遇到了一些麻烦。 我有一个由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

我在这个项目上遇到了一些麻烦。 我有一个由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')

因为有人在取笑我,所以它真的很匆忙。

用“plsql”函数替换“mysql”函数 带substr的子字符串 在要连接的内容之间使用| |进行连接 如果convert要将类型更改为number,则将其替换为to_number