Select Top in Union test


Please login or register to vote for this query.

(click on this box to dismiss)

Genealogy and Family History Meta

Q&A about the site for expert genealogists and people interested in genealogy or family history

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

Switch to main site
loading Hold tight while we fetch your results