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

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

where t.cpintid = 'djdjdj';

posted @ 2017-05-18 16:47  羽翼时空  阅读(5487)  评论(0编辑  收藏  举报