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
Can we join more than 2 tables in sql?
How to assign sql query results to pl sql variables?
Explain the components of sql?
Where is pl sql used?
How do I start sql from command line?
Explain the difference between cursor declared in procedures and cursors declared in the package specification?
What do you mean by stored procedures? How do we use it?
Does oracle roll back the transaction on an error?
What are different sql data types?
What is left join in sql?
how to calculate the difference between two dates? : Sql dba
What is sql query optimization?
How many types of functions are there in sql?
what is oracle database ? : Sql dba
What is the difference between an inner and outer join?