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 type of database is cloud sql?
how do you know the version of your mysql server? : Sql dba
Explain the order of sql statement execution?
Explain the difference in execution of triggers and stored procedures?
What is the use of stored procedures?
what are the different type of sql's statements ? : Sql dba
how do you tune the slow running queries in oracle db , explain the methodology
Explain polymorphism in pl/sql.
How do I run a sql query in pgadmin 4?
what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba
What are all the common sql functions?
What is the difference between delete and truncate statement in sql?
What are inner outer left and right joins in sql?
What are different types of triggers?
what is a cursor? : Sql dba