select odd records sql

Solutions on MaxInterview for select odd records sql by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "select odd records sql"
Emily
25 Feb 2017
1SELECT t.First, t.Last
2FROM (
3    SELECT *, Row_Number() OVER(ORDER BY First, Last) AS RowNumber 
4            --Row_Number() starts with 1
5    FROM Table1
6) t
7WHERE t.RowNumber % 2 = 0 --Even
8--WHERE t.RowNumber % 2 = 1 --Odd
9