How One can easily select all even, odd, or Nth rows from a
table using SQL queries?

Answer Posted / mahesh

SIMPLE ODD AND EVEN...

SQL> SELECT ROWNUM FROM EMP GROUP BY ROWNUM HAVING MOD(ROWNUM,2)=1
2 /

ROWNUM
----------
1
3
5


1* SELECT ROWNUM FROM EMP GROUP BY ROWNUM HAVING MOD(ROWNUM,2)=0
2 /

ROWNUM
----------
2
4
Goahead...

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to create startup or shutdown trigger for on-schema?

675


How do you take the union of two tables in sql?

605


How exception handling is done in advance pl/sql?

593


How to pronounce postgresql?

655


what are aggregate and scalar functions? : Sql dba

653






Explain the structure of pl/sql in brief.

697


What is the use of sql trace?

569


Explain how to use transactions efficiently : transact sql

622


what is datawarehouse? : Sql dba

661


What is java sql connection?

601


What does joining a thread mean?

640


How many types of triggers are there in pl sql?

677


How do I start sql from command line?

616


What are the two types of exceptions.

720


How can you load multi line records? : aql loader

726