原先对MSSQL数据库进行一些操作,用到用下SQL语句,没问题。
但是最近因为工作需要,数据库转换成了orcle的,再执行如下语句就不行了,总是提示未正确结束,我把“go”去掉,逐条运行也不行,提示没正确的表达式。
请帮忙看看如何改成orcle能顺利运行的语句。
update cert set double_flag='1'
where double_certsn is null and cert_status='use' and ctml_name like '%签名%'
goupdate cert set double_flag='2'
where double_certsn is null and cert_status='use' and ctml_name like '%加密%'
goupdate cert set double_certsn=convert(varchar(50),certsn)+'0000'
where double_certsn is null and cert_status='use' and ctml_name like '%签名%'
goUPDATE A SET
double_certsn=B.double_certsn
FROM cert AS A
JOIN cert AS B
ON A.subject=B.subject
WHERE B.double_certsn IS NOT NULL
AND A.double_certsn IS NULL
AND A.cert_status='use'
go
但是最近因为工作需要,数据库转换成了orcle的,再执行如下语句就不行了,总是提示未正确结束,我把“go”去掉,逐条运行也不行,提示没正确的表达式。
请帮忙看看如何改成orcle能顺利运行的语句。
update cert set double_flag='1'
where double_certsn is null and cert_status='use' and ctml_name like '%签名%'
goupdate cert set double_flag='2'
where double_certsn is null and cert_status='use' and ctml_name like '%加密%'
goupdate cert set double_certsn=convert(varchar(50),certsn)+'0000'
where double_certsn is null and cert_status='use' and ctml_name like '%签名%'
goUPDATE A SET
double_certsn=B.double_certsn
FROM cert AS A
JOIN cert AS B
ON A.subject=B.subject
WHERE B.double_certsn IS NOT NULL
AND A.double_certsn IS NULL
AND A.cert_status='use'
go
解决方案 »
- Spring Security 连接Oracle 找不到SID
- 关于oracle存储过程的问题
- 能否实现以下 行转列?
- 请问java如何调用输入参数为数组的oracle存储过程!急
- 请教:计算N天后时间存储过程
- oracle 是否有参数可以限制连入的 connection 数量
- 数据库中记录被修改,如何查到是谁修改的?
- 我的机器上安装了Oracle 8.1.6,过了一段时间服务启动不起来了。
- 【求助】关于"Internal Password"……(版本805,Oracle Database Assistant的使用)
- 有关序列(sequence)的问题
- PL/SQL连接不上oracle数据库
- oracle 向同一个表中插入多行数据
每句SQL结束时,加个分号(;)
我个人比较喜欢这样的写法:
UPDATE
(SELECT rolling_code_id
FROM tb_client_win_lost_report a,
temp_role_id b
WHERE a.role_id =b.id
AND rolling_code_id=1
) a
SET a.rolling_code_id=2;