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
What is a cursor, index in sql?
What are the new features introduced in SQL Server 2000? What changed between the previous version of SQL Server and the current version?
Explain the functionalities that views support?
What is Lock table in SQL?
what are cursors? : Sql server database administration
How to turn on the mssql api module in php?
Can we take the full database backup in log shipping?
What is store procedure?
Sql studio em braces a variety of capabilities, but will I need them all? Is there a simpler product ? : sql server management studio
Explain how to maintain a fill factor in existing indexes?
Tell me what are the advantages of using stored procedures?
Which data type columns are the best candidates for full-text indexing?
What is stored procedures?
What are the restrictions applicable while creating views? : SQL Server Architecture
Can one drop a column from a table?