Select Participants from table will result in
I want a query where the results shows
A good sample for this question is the query used in generating single-elimination tournament pairings.
Thank you very much in advance
do you need the result to be exactly as you have it or any combination will do?
The exact result is preferable
Is there are any other columns that are associated with this list? What is the basis of their relationship?
i tried to do this ... hope this helps
create table data ( name varchar(100) )
insert into data values
; with cte as
select ROW_NUMBER() over( order by (select null)) as rn , * from data
select ROW_NUMBER() over( order by (select null)) as rn1,* from cte where Rn%2=1
select ROW_NUMBER() over( order by (select null)) as rn1,* from cte where Rn%2=0
on a.rn1= b.rn1
Thank you very much harishgg1 .. perfect solution .. exactly as I wanted .. you are #1
It will eventually fail because there is absolutely nothing in the original list to preserve the order you want and you cannot rely on the "implicit" order in the table.