SELECT distinct * FROM (
SELECT A.[NURS_STA]
,A.[RM_BED]
,A.[MRN]
,A.[NAME]
,A.[ADM_DATE]
,A.[ATN_DR]
,A.[LOS]
,A.[ACCT_NO]
,A.[DX0]
,B.[DX0] AS [DX1]
,C.[DX0] AS [DX2]
FROM [Census] A
LEFT OUTER JOIN [Census] B on A.[MRN] = B.[MRN]
LEFT OUTER JOIN [Census] C ON A.[MRN] = C.[MRN]
)A
|