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 / vijayplsql@gmail.com

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 ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is a join? : Sql server database administration

539


What are diverse clauses that form a part of sql?

593


What is self contained sub query?

553


What are types of storage modes? : sql server analysis services, ssas

576


What does set rowcount do?

506






What are the key configuration files for sql server reporting services ?

120


what is the difference in login security modes between v6.5 and 7.0? : Sql server database administration

643


What is a database table?

517


How can we remove orphan records from a table?

524


What is a recursive stored procedure in sql server?

563


Tell me something about security and sql azure?

100


Explain datetime2 data type in sal server 2008?

545


What is row_number () and partition by in sql server?

516


Explain about Views?

597


What is the syntax for encrypting a column in SQL Server?

551