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
What is normalisation and its types?
Explain commit, rollback and savepoint.
What are sql functions? Describe the different types of sql functions?
What is not null in sql?
define data blocks ? : Sql dba
Why is nosql good?
What are the parts of a sql statement?
What is the left table in sql?
What are aggregate and scalar functions?
How many sql are there?
What does (*) mean in sql?
Is join and inner join the same?
What is rowid in sql?
How many sql databases can you have on one server?
what is a cursor? : Sql dba