This can use some tweaking, but it should get you started.declare @MyTable table (name varchar(15),num1 int,num2 int,num3 int)insert into @MyTable(Name,num1,num2,num3)select 'JEFF' , 595 , NULL , NULL Union allselect 'JEFF' , 599 , NULL , NULL Union allselect 'JEFF' , 599 , 789 , NULL Union allselect 'JEFF' , 599 , NULL , NULL Union allselect 'JEFF' , 788 , 595 , NULL Union allselect 'JEFF' , 784 , NULL , 328 Union allselect 'Bill' , 895 , NULL , NULL Union allselect 'Bill' , 449 , NULL , 472 Union allselect 'Bill' , 119 , 239 , NULL select a.Name,a.Num1,b.Num2,c.num3from(Select row_Number() over (Partition by name order by name) as rowID,*from @mytablewhere not num1 is null) aLeft Join(Select row_Number() over (Partition by name order by name) as rowID,*from @mytablewhere not num2 is null) bon a.RowID = b.RowIDand a.Name = b.NameLeft join(Select row_Number() over (Partition by name order by name) as rowID,*from @mytablewhere not num3 is null) con a.RowID = c.RowIDand a.Name = c.Namewhere a.RowID =1
Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881