Hi,
This what you're after?...
declare @temp table (guid int, testid int, testtypeid int)
insert into @temp select 1, 1, 1
insert into @temp select 2, 1, 1
insert into @temp select 3, 1, 2
insert into @temp select 5, 1, 3
insert into @temp select 6, 1, 3
insert into @temp select 7, 1, 4...