top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How can we get alternative rows from a table in sql server

+4 votes
495 views
How can we get alternative rows from a table in sql server
posted Dec 24, 2013 by Neeraj Pandey

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

select t1.*, (RN % 2)+1 as [STATUS] from
(
select t.*, ROW_NUMBER() OVER (ORDER BY ) as RN
) t1

answer Dec 26, 2013 by Anuj Mishra
...