有什么方法可以将以下内容和 set @FH_RecordKey
and组合@VF_dept_seq
在一个SET
orSELECT
语句中?
set @FH_RecordKey =(
case @lnktble
when 'ems' then (select FH_inci_id from FH_Catherine_live.dbo.FH_MAP_EMS_INCI where VF_ems_seq = @tempseq)
when 'imaster' then (select FH_insp_id from FH_Catherine_live.dbo.FH_MAP_INSPID where VF_in_seq = @tempseq)
when 'n5basic' then (select inci_id from [dbo].[VF_IncWorkTable] where inc_seq = @tempseq)
END)
set @VF_dept_seq = (
case @lnktble
when 'ems' then (select VF_dept_seq from FH_Catherine_Live.dbo.FH_MAP_EMS_INCI where VF_ems_seq = @tempseq)
when 'imaster' then (select VF_dept_seq from FH_Catherine_Live.dbo.FH_MAP_INSPID where VF_in_seq = @tempseq)
when 'n5basic' then (select dept_seq from [dbo].[VF_IncWorkTable] where inc_seq = @tempseq)
end)