0
SELECT NM1.nm101,
CLP.Segment_GUID as CLPSegmentGuid,
CASE NM1.nm101
WHEN 'QC' THEN 'Patient'
WHEN 'IL' THEN 'Insured'
WHEN '74' THEN 'Corrected'
WHEN '82' THEN 'Crossover'
END As type,
NM1.NM102 As Entity_Type_Qualifier,
NM1.NM103 As Entity_Last_Name,
NM1.NM104 As Entity_First_Name,
NM1.NM105 As Entity_Middle_Name,
NM1.NM108 As Entity_Identification_Code_Type,
NM1.NM109 As Entity_Identification_Code
FROM X12_NM1 As NM1
INNER JOIN X12_CLP As CLP
ON CLP.segment_guid = NM1.parent_segment_guid and NM1.Loop_Id ='2100'
這裏if nm1.nm108 = MI
然後我想要那些MI的結果集。關於如果否則在T-SQL
只是爲了澄清 - 你想從您發佈的查詢中排除nm108不等於'MI'的行嗎? – Dan
CASP LOCK ALERT !!!!!!! –
@SonerGönül出於某種原因,SQL程序員傾向於將它們的標題寫入全部大寫。 – 2013-08-21 16:44:29