What should the output be like if the result of your current query was this, or some other similar combination?004NOR003 2P2 NULL004NOR003 XYZ SC
If you have only one valid value for Apt Size and Contained Status for any given PlaceRef, you can use the Max function like this:SELECT Loc.PlaceRef, MAX(CASE WHEN LocAtt.AttributeCode = 'PAPT' THEN LocAtt.SubAttributeCode END) AS [Apt Size], MAX(CASE WHEN LocAtt.AttributeCode = 'SLFC' THEN LocAtt.SubAttributeCode END) AS [Contained Status]FROM dbo.vwLocationCurrent AS Loc JOIN dbo.vwLocationAttributesCurrent AS LocAtt ON Loc.PlaceRef = LocAtt.PlaceRefWHERE Loc.PlaceRef = '004NOR003' AND ( LocAtt.AttributeCode = 'PAPT' OR LocAtt.AttributeCode = 'SLFC' )GROUP BY Loc.PlaceRef