Remember
Register
1
new
Chill
new
Puzzles
new
GK
new
Sports
new
Business
Home
Questions
MCQs
Unanswered
Tags
Users
Ask a Question
Write Article
Articles
Connect to us
How can we get alternative rows from a table in sql server
+4
votes
490
views
How can we get alternative rows from a table in sql server
sql server
posted
Dec 24, 2013
by
Neeraj Pandey
Share this question
Your comment on this post:
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
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
Your comment on this answer:
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
Your answer
Preview
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
Similar Questions
+4
votes
SQL Server: How can we remove duplicate rows from a table
+4
votes
How can we get comma separated values from a column in a table
+1
vote
Is there a way to create a SQL Server function to “join” multiple rows from a subquery into a single delimited field?
0
votes
How we can delete duplicate rows in a table with no unique key in SQL server ?
0
votes
How to Get table create and last modify date time using PL-SQL in SQL server 2008?
...