That's actually not that simple.SELECT CASE WHEN A_NULL_Count = 0 AND B_NULL_Count = Row_Count THEN 'A' WHEN B_NULL_Count = 0 AND C_NULL_Count = Row_Count THEN 'B' --WHEN ... END AS Final_ResultFROM ( SELECT SUM(CASE WHEN A IS NULL THEN 1 ELSE 0 END) AS A_NULL_Count, SUM(CASE WHEN B IS NULL THEN 1 ELSE 0 END) AS B_NULL_Count, SUM(CASE WHEN C IS NULL THEN 1 ELSE 0 END) AS C_NULL_Count, SUM(1) AS Row_Count FROM dbo.tablename) AS derived