以下是Oracle的PLSQL语句,请高手帮我转换成SQL Server可以执行的。主要是一个(+)的问题搞不定。用left join不是很会用,请大家帮忙,分不够再加。 select doc.docid,doc.subject,doc.createtime --
,doc.author,doc.folder,doc.formid,doc.version --
,flowlib.flowlibid, flowlib.name as flowname--
,wfinst.curActivity ,wa2.stateName as curStepName-- //
, wfinst.id as flowid--
,wa.defid stepid,wa.defname -- //
,wa.id as wfactid,wa.defid actdefid ,wa.statename as stepname-- //
, ws.id as assignid ,ws.state as wsstate , ws.createddate as assigncreatetime ,tuser.userid,tuser.loginid ,tuser.name --
from document doc,flowlib,wfprocess wfinst ,wfactivity wa--
,wfassignment ws ,tuser,org selforg,org parentorg --
,wfactivity wa2 --//
where doc.flowlibid=flowlib.flowlibid --
and doc.flowid=wfinst.id--
and ws.processid=wfinst.id --
and ws.activityid=wa.id--
and wa.processid=wfinst.id--
and doc.formid<>986 -- //
and ws.assignee=tuser.userid--
and wfinst.curActivity=wa2.id-- //
and tuser.orgid=selforg.orgid--
and selforg.orgpid=parentorg.orgid(+)--
and ws.id in( --
select max(wfass.id) as assignID --
from document doc,wfassignment wfass,wfactivity wfa ,tuser --
where wfass.activityid=wfa.id --
and wfass.processid=doc.flowid--
and wfa.processid=doc.flowid --
and wfass.assignee=tuser.userid --
and tuser.userid= 144--userid+ //
and wfass.state<3--
group by doc.docid --
)--
order by assigncreatetime DESC;
,doc.author,doc.folder,doc.formid,doc.version --
,flowlib.flowlibid, flowlib.name as flowname--
,wfinst.curActivity ,wa2.stateName as curStepName-- //
, wfinst.id as flowid--
,wa.defid stepid,wa.defname -- //
,wa.id as wfactid,wa.defid actdefid ,wa.statename as stepname-- //
, ws.id as assignid ,ws.state as wsstate , ws.createddate as assigncreatetime ,tuser.userid,tuser.loginid ,tuser.name --
from document doc,flowlib,wfprocess wfinst ,wfactivity wa--
,wfassignment ws ,tuser,org selforg,org parentorg --
,wfactivity wa2 --//
where doc.flowlibid=flowlib.flowlibid --
and doc.flowid=wfinst.id--
and ws.processid=wfinst.id --
and ws.activityid=wa.id--
and wa.processid=wfinst.id--
and doc.formid<>986 -- //
and ws.assignee=tuser.userid--
and wfinst.curActivity=wa2.id-- //
and tuser.orgid=selforg.orgid--
and selforg.orgpid=parentorg.orgid(+)--
and ws.id in( --
select max(wfass.id) as assignID --
from document doc,wfassignment wfass,wfactivity wfa ,tuser --
where wfass.activityid=wfa.id --
and wfass.processid=doc.flowid--
and wfa.processid=doc.flowid --
and wfass.assignee=tuser.userid --
and tuser.userid= 144--userid+ //
and wfass.state<3--
group by doc.docid --
)--
order by assigncreatetime DESC;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货