I'm struggling a bit here. It seems easy, but I 'm not getting it.
I'm trying to make 1 row from 2 rows where if 1 row has no data and the second one does, then get the distinct row with all the data. Kind of a merge.
My example table with 2 rows of different values, same ID.
CREATE TABLE #Temp (ID INT, LegalName VARCHAR(25), City VARCHAR(15), Zip CHAR(5))
INSERT INTO #temp
VALUES (184382, 'Insurance Agency', 'Redding', ''), (184382, 'Insurance Agency', '', '96002')
How do I get 1 row with all the values?
There is an exception to every rule, except this one...