-1
ID | First Name | Last Name |
-----------------------------
1  | Test       | NULL      |
2  | Test       | ABC1      |

I need to merge these two rows into one to display as so the null in 'last name' will be replaced by the text in the second column, Grouping by the first name.

 ID | First Name | Last Name |
 -----------------------------
 1  | Test       | ABC1|
Filburt
  • 17,626
  • 12
  • 64
  • 115
SRA
  • 1,681
  • 7
  • 27
  • 49
  • 2
    But what have you tried yourself? – J. Steen Aug 08 '12 at 12:01
  • But what you have *searched* for? – gbn Aug 08 '12 at 12:09
  • possible duplicate of [Simulating group_concat MySQL function in MS SQL Server 2005?](http://stackoverflow.com/questions/451415/simulating-group-concat-mysql-function-in-ms-sql-server-2005). Or this http://stackoverflow.com/q/1874966/27535 – gbn Aug 08 '12 at 12:09
  • Did any below answer made you feel happy ? –  Aug 08 '12 at 20:58

1 Answers1

0

try this:

select min (id),First_Name,MAX(Last_Name)
from your_table
group by First_Name
Joe G Joseph
  • 23,518
  • 5
  • 56
  • 58