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

Explain concepts of analysis services?

515


Can foreign key be deleted?

532


Can we install sql server 2016 on windows 7?

677


What is the process of indexing?

522


What is snapshot replication?

599






What is difference between index and primary key?

593


Does partitioning improve performance?

493


How to retrieve error messages using mssql_get_last_message()?

539


Tell me what is normalization? Explain different forms of normalization?

550


What are xml indexes?

532


explain different levels of normalization? : Sql server database administration

525


You want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition?

542


Explain about system database?

580


Why people hate cursor?

733


What does the automatic recovery do?

579