嗨,我有 1 列的条件,它应该是这样的
select
WHEN NM1.nm101 = 'IL' THEN ( CLP.Segment_GUID as CLPSegmentGuid,
NM1.NM102 as [INSURED_Entity_Type_Qualifier],
NM1.NM103 as [INSURED_Entity_Last_Name],
NM1.NM104 as [INSURED_Entity_First_Name],
NM1.NM105 as [INSURED_Entity_Middle_Name],
NM1.NM108 as [INSURED_Entity_Identification_Code_Type],
NM1.NM109 as [INSURED_Entity_Identification_Code])
WHEN NM1.nm101 = '74' THEN ( CLP.Segment_GUID as CLPSegmentGuid,
NM1.NM102 as [Corrected_Entity_Type_Qualifier],
NM1.NM103 as [Corrected_Entity_Last_Name],
NM1.NM104 as [Corrected_Entity_First_Name],
NM1.NM105 as [Corrected_Entity_Middle_Name],
NM1.NM108 as [Corrected_Entity_Identification_Code_Type],
NM1.NM109 as [Corrected_Entity_Identification_Code])
ELSE NM1.nm101 = '82' THEN ( CLP.Segment_GUID as CLPSegmentGuid,
NM1.NM102 as [CROSSOVER_Entity_Type_Qualifier],
NM1.NM103 as [CROSSOVER_Entity_Last_Name],
NM1.NM104 as [CROSSOVER_Entity_First_Name],
NM1.NM105 as [CROSSOVER_Entity_Middle_Name],
NM1.NM108 as [CROSSOVER_Entity_Identification_Code_Type],
NM1.NM109 as [CROSSOVER_Entity_Identification_Code])
From X12_NM1 NM1
Inner Join X12_CLP CLP
ON CLP.segment_guid = NM1.parent_segment_guid
因此,对于该特定列 NM101 在执行 select 语句时,我必须查看条件并返回列,任何人都可以对此提供帮助。