I need assistance on how to make my subquery pull the correct record. At the heart of the issue is the fact that the lookup table, propery type codes does not and cannot have unique records. I have attached the table.
Here is the subquery:
FROM dbo.[C_Property_type code] cp
WHERE cp.[C_PROP TYPE CODE] = CI.[PROPERTY_TYPE_CD]
) as [State Code]
CI.[property_type_cd] is one element of the table that resides in the TSQL program that this subquery is embedded in. They are both found in the single SQL Server databse that I am using on my SQL Server.