UPDATE WF_WORKFLOW_NODE_ELE Set user_code =initiator
from wf_workflow where WF_WORKFLOW_NODE_ELE.workflow_code=wf_workflow.workflow_code
而这个set user_code 如何进行判断?
因为在WF_WORKFLOW_NODE_ELE 中user_code 代表为一个人,前面有其他字段进行判断。
在线等,拜托了~~
------解决方案--------------------
--不是太理解lz的意思,看下面的2个语句是否有用?
UPDATE WF_WORKFLOW_NODE_ELE Set user_code =initiator
from wf_workflow where WF_WORKFLOW_NODE_ELE.workflow_code=wf_workflow.workflow_code
and user_code ='判断条件'
UPDATE WF_WORKFLOW_NODE_ELE Set user_code =(case initiator when .. then .. else ..end)
from wf_workflow where WF_WORKFLOW_NODE_ELE.workflow_code=wf_workflow.workflow_code
------解决方案--------------------
对user_code的判断条件就写在where后面
UPDATE WF_WORKFLOW_NODE_ELE Set user_code=new数据(新某人)
from wf_workflow where user_code=条件(某人)
and WF_WORKFLOW_NODE_ELE.workflow_code=wf_workflow.workflow_code
------解决方案--------------------
没明白你的意思,不过你可以加个判断 case when 呗
UPDATE WF_WORKFLOW_NODE_ELE
Set user_code = case when col='num1' then initiator else 'num2'
from wf_workflow where WF_WORKFLOW_NODE_ELE.workflow_code=wf_workflow.workflow_code
------解决方案--------------------
UPDATE WF_WORKFLOW_NODE_ELE Set user_code =initiator
from wf_workflow where WF_WORKFLOW_NODE_ELE.workflow_code=wf_workflow.workflow_code
and workflow_node_code='0000000002'
and workflow_nodeele_code='0000000002'
后面的
and workflow_node_code='0000000002'
and workflow_nodeele_code='0000000002'
竟然是user_code的判断????
------解决方案--------------------
不是你说的么,user_code如何进行判断???
------解决方案--------------------
为什么不用存储过程,需要这么麻烦吗?