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


Please Help Members By Posting Answers For Below Questions

Describe the left outer join & right outer join. : sql server database administration

580


What is the maximum number of instances in 32 bit and 64 bit sql server 2012?

520


How to delete duplicate records based on single column from a table?

601


 Explain what is sql override for a source taLle in a mapping?

569


What are sub reports and how to create them?

99






What is the datatype of rowid?

504


What is update locks?

509


What is data set in report?

95


Tell me what are cursors and when they are useful?

506


What is inline variable assignment?

595


If no size is defined while creating the database, what size will the database have?

544


What is forward - only cursors / read only cursor?

516


You want to generate a report that is formatted as a chart. Can you use the report wizard to create such a report?

88


What is mssql?

564


When would you prefer to have a minimum number of indexes?

503