display records from 5 to 9 using rowid or rownum
Answers were Sorted based on User's Feedback
Answer / vinay shankar
select * from emp
where rownum <=9
minus
select * from emp
where rownum <5
| Is This Answer Correct ? | 31 Yes | 6 No |
Answer / chiru
select * from (select rownum r ,a.* from emp a ) where r between 5 and 9
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / ramaraju
select
ename
from
emp
order by ename
offset 4 rows
fetch next 5 rows only;
try this answer oracle 12c introduced offset fetch rows.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / hari
select * from (select rownum rm,id from emp where rownum<=9) where rn >=5)
| Is This Answer Correct ? | 4 Yes | 5 No |
Answer / satya
select empno,ename,sal from emp
group by rownum,empno,ename,sal
having rownum between 5 and 9;
| Is This Answer Correct ? | 2 Yes | 9 No |
Does pl/sql support create command?
What is an exception in pl/sql?
Which one is the Best approach to put code, among Triggers and Procedures? Explain?
What is localdb mssqllocaldb?
have table with two columns with datatypes as number and varchar and the values in A column like 1,2,3 AND B column values like a,b,c. now need to display data in a single column as 1,a,2,b,3,c.
Does truncate release storage space?
What is a schema in sql?
what is the correct way of selection statement a. select/from/table_name/orderby/groupby/having b. select/from/table_name/groupby/having/orderby
5 Answers HCL, JPMorgan Chase,
Explain alias in sql?
How to execute multiple sql statements in a single annonymous block irrespective of the sql statement result?
what are the advantages of sql ? : Sql dba
How are sql commands classified?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)