比如在数据库中更新一条数据,当fabusj为空时进行赋值,不为空时保留原来的数据。这样的sql语句该如何写? 我是要把这条语句用在jsp页面中 如:update office set fbflag='已发布',blzt='1',(fabusj=?(这个字段为空时才进行赋值)) where workflowinstance_guid=?"nvl(要赋的值,原来的值)?? update office set fbflag='已发布',blzt='1',fabusj=nvl(fabusj,sysdate) where workflowinstance_guid=? fabusj=nvl(fabusj,value) 用nvl,如果fabusj为null,就修改为value 如果fabusj不为null,就修改为fabusj
好的,我再试试。 我写的语句是这样的,不会是语句有问题吧 update office set fbflag='已发布',blzt='1',fabusj=nvl(?,(select fabusj from office where workflowinstance_guid=?)) where workflowinstance_guid=? update office set fbflag='已发布',blzt='1',fabusj=nvl(fabusj,'为空赋值')) where workflowinstance_guid=? update office set fbflag='已发布',blzt='1',fabusj=nvl(?,(select fabusj from office where workflowinstance_guid=?)) where workflowinstance_guid=?
oracle 11g 安装 01092 错误, 日志信息: [oracle@linux trace]$ vi alert_orcl.log MMON started with pid=14, OS id=9089 RESETLOGS after incomplete recovery UNTIL CHANGE 522752 Errors in file / ......