I’ve searched around a bit and couldn’t find anything that addressed my exact issue
I have a table (MSSQL), and the data looks like this:
Source table:
RID FullName FirstName LastName Email Address
-------------------------------------------------------------------------------
1 NULL [BOB] NULL NULL NULL
1 NULL NULL [BOB] NULL NULL
1 NULL NULL NULL [bob@bob.com] NULL
2 NULL [JAY] NULL NULL NULL
2 NULL NULL [JAY] NULL NULL
2 NULL NULL NULL [jerry@jerry.com] NULL
3 NULL [RICK] NULL NULL NULL
3 NULL NULL [RICK] NULL NULL
3 NULL NULL NULL [rick@rick.com] NULL
But I need to transform the data to look like this:
Results table:
RID FullName Email Address
---------------------------------------------------------
1 [BOB] [BOB] [bob@bob.com] NULL
2 [JAY] [JAY] [jerry@jerry.com] NULL
3 [RICK] [RICK] [rick@rick.com] NULL
NOTE: If Fullname from the source table is NULL, then we combine FirstName and LastName. (If both FirstName and LastName are NULL, then we simply have a NULL FullName result, which is completely fine).
Thanks in advance for any help on this!
You need a
group by: