oracle 修改某字段,判断是否为空,若是为空赋默认值

update table_complaint t
set t.cptdatetime = nvl2(t.cptdatetime,
'',
to_char(to_date(t.cptdatetime,
'yyyy-mm-dd hh24:mi:ss') - 2))html

where t.cpintid = 'djdjdj';post

转载于:https://www.cnblogs.com/lwy1103/p/6874199.htmlhtm