Hi All,
I've simple question on the below join, What I am understanding is:
If the --1st Join do not return data it evaluates --2nd join and if this also do not return data it checks for --3rd if third returns data it will be [DDCM].[ReptColName]
If Join 1 returns data it will be [MPM1].[MiProgram] and if 2nd returns data it will be [MPM2].[MiParent]
from the business I understand that all 3 will not return data at anytime, it will one only one join which returns
SELECT ISNULL( ISNULL([MPM1].[MiProgram], [MPM2].[MiParent]) ,[DDCM].[ReptColName] ) AS [FCategory] FROM R2 LEFT JOIN [DBO].[vwPrgMapping] AS [MPM1] ON [MPM1].[Category] = [R2].[FilterLabel] --1 LEFT JOIN [DBO].[vwParentMapping] AS [MPM2] ON [MPM2].[Category] = [R2].[FilterLabel] --2 LEFT JOIN [DBO].[vwDDMapping] AS [DDCM] ON [DDCM].[Category] = [R2].[FilterLabel] --3