top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

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

+4 votes
76 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 Google+ Share Button LinkedIn Share Button Multiple Social 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
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...