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
Why should I use postgresql?
How to fix oracle error ora-00942: table or view does not exist
How many parts of a pl sql block are optional?
how to use in conditions? : Sql dba
What is the clause we need to add in function body to return variable?
what is a composite primary key ? : Sql dba
How much does a sql dba make? : SQL DBA
Which function is used to return remainder in a division operator in sql?
Does a join table need a primary key?
How can you tell the difference between an index and a view?
What are sql functions? Describe the different types of sql functions?
what is a tablespace? : Sql dba
Mention what does the hierarchical profiler does?
Do stored procedures prevent sql injection?
What are triggers and its types?