how to write the query to select the rows are in the order
of either 1,3,5,7... or 2,4,6,8,...
Answer Posted / vijay sultampur
For 1,3,5,7...
select * from emp where (rowid,1) in (select rowid,mod
(rownum,2) from emp);
For 2,4,6,8,...
select * from emp where (rowid,0) in (select rowid,mod
(rownum,2) from emp);
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
How to count groups returned with the group by clause in ms sql server?
How do you rebuild an identity column?
What is the maximum rows in sql server table?
What is stretch database in sql server?
What is the difference between Triggers and Stored Procedure?
What is scd (slowly changing dimension)? : sql server analysis services, ssas
What is the sql case statement used for? Explain with an example?
What are the options which must be set to allow the usage of optimistic models?
How to select an exiting database using mssql_select_db()?
Difference between Sql server reporting services and Crystal reports?
What is sleeping status in sql server?
What are the main differences between #temp tables and @table variables and which one is preferred?
how can you attach more than 20 ldf files in sql server
What is SQL Azure Firewall?
Will sql server 2005 allow you to reduce the size of a column?