博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle 更新多条数据
阅读量:7011 次
发布时间:2019-06-28

本文共 1028 字,大约阅读时间需要 3 分钟。


 

select sid, cjsj

from base_zjxx
where cjsj = to_date('0001/1/1', 'yyyy/mm/dd');

select *

from sys_user
where qyid in (90656, 90655, 90646, 90641, 90636, 90633, 90631);

UPDATE base_zjxx

SET cjsj = (CASE
WHEN zjid = '90656' THEN
to_date('2015/4/7 15:57:49', 'yyyy/mm/dd hh24:mi:ss')
WHEN zjid = '90655' THEN
to_date('2015/4/7 14:45:15', 'yyyy/mm/dd hh24:mi:ss')
WHEN zjid = '90646' THEN
to_date('2015/4/3 10:45:01', 'yyyy/mm/dd hh24:mi:ss')
WHEN zjid = '90641' THEN
to_date('2015/4/2 9:43:55', 'yyyy/mm/dd hh24:mi:ss')
WHEN zjid = '90636' THEN
to_date('2015/4/1 15:58:11', 'yyyy/mm/dd hh24:mi:ss')
WHEN zjid = '90633' THEN
to_date('2015/4/1 14:32:58', 'yyyy/mm/dd hh24:mi:ss')
WHEN zjid = '90631' THEN
to_date('2015/4/1 10:30:23', 'yyyy/mm/dd hh24:mi:ss')
ELSE
cjsj
END)
where zjid in (90656, 90655, 90646, 90641, 90636, 90633, 90631)

 


 

update base_zjxx t1 set

t1.cjsj =
(select CREATE_DATE
from sys_user t2
where t1.zjid = t2.sid ) where
t1.cjsj = to_date('0001/1/1', 'yyyy/mm/dd')

转载于:https://www.cnblogs.com/zlggyn/p/4468457.html

你可能感兴趣的文章