UPDATE herp_budg_data.BudgChecktRec a SET BSAR_StepNO=(
SELECT BSARD_StepNO FROM herp_budg_data.BudgChecktRecDetail b
WHERE a.BSAR_Rowid=b.BSARD_CheckRecId AND b.BSARD_CurStep=:curstep AND a.BSAR_Chercker=b.BSARD_CherckerDR)
//在sqldbx里执行的时候不能要最后一行,往往生成的userid需要用select in进行查询,效率很低
//所以不建议在数据比较多的时候用该方式生成字符串
SELECT stuff(
(select XMLAGG(distinct ','||b.BCFD_ChkFstDR)
from herp_budg_data.BudgSchemMain a,
herp_budg_data.BudgCheckFlowDetail b
where a.BSM_Year=:Year and a.BSM_UnitType='2' and
a.BSM_CHKFlowDR->BCFM_Rowid = b.BCFD_ChkFlowDR and b.BCFD_StepNO=0)
,1,1,'')into:userids