Select Top in Union test

1

Please login or register to vote for this query.

(click on this box to dismiss)

Network Engineering

Q&A for network engineers

With S As (select 1 as [Index] union select 2 union select 3 union select 4 union select 5 union select 6)

Select Top 2 1 as [Order], [Index] From S Where 2*([Index]/2)=[Index]

Union All

Select Top 2 2 as [Order], [Index] From S Where 3*([Index]/3)=[Index]

order by [Order], [Index]

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results