troubleshooting Question

Subquery non unique records

Avatar of Leogal
LeogalFlag for United States of America asked on
Microsoft SQL Server 2008
10 Comments1 Solution232 ViewsLast Modified:
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:
 (
                 SELECT cp.[c.PROP_TYPE_CODE]
                         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.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros