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 a unique constraint?
What is a record in pl/sql?
What is sap sql?
Can we perform dml on view?
What does a pl/sql package consist of?
how to run 'mysql' commands from a batch file? : Sql dba
how to select unique records from a table? : Sql dba
How do you take the union of two tables in sql?
What do you understand by pl/sql records?
What is primary and foreign key?
Can we join tables without foreign key?
What is a temporal data type?
Is subquery faster than join?
How to write a query to show the details of a student from students table whose
What is the difference between join and natural join?