Using SQL Server 2008
I have a pretty long query but the problem I am having is on the left join. I need to left join because there may or may not be a value in there, but when the record has a value I get both records (a value and then a null) and when there is no value I get the single Null value. What I am trying to do is if there is a value there only return that single value and if there is no value then return the Null. I will show examples below.
JOIN Example
LEFT OUTER JOIN TABLE1 1 on 1.ID = 2.ID AND 1.Number = '1234'
Results
John Smith 1234
John Smith NULL
Jane Doe NULL
Wanted Results
John Smith 1234
Jane Doe NULL
Any help would be appreciated
I have a pretty long query but the problem I am having is on the left join. I need to left join because there may or may not be a value in there, but when the record has a value I get both records (a value and then a null) and when there is no value I get the single Null value. What I am trying to do is if there is a value there only return that single value and if there is no value then return the Null. I will show examples below.
JOIN Example
LEFT OUTER JOIN TABLE1 1 on 1.ID = 2.ID AND 1.Number = '1234'
Results
John Smith 1234
John Smith NULL
Jane Doe NULL
Wanted Results
John Smith 1234
Jane Doe NULL
Any help would be appreciated