Hi Everyone,
How to get fist and last record from a table in oracle?
Thanks in advance
Answer Posted / venkyhulk1
select *
from (select rownum r, e.* from emp e)
where r in ((select max(rownum) from (select rownum , e.*
from emp e)),(select min(rownum) from (select rownum , e.*
from emp e)))
this querry will get the first and last records of the table
with respect to the way the data is stored in the table
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is sqlerrd?
what is the difference between join and union? : Sql dba
what is a primary key? : Sql dba
What is difference between mysql and postgresql?
Is sql low level language?
Is left join same as join?
What is the main difference between sql and pl/sql?
What is information schema in sql?
Can we insert data into materialized view?
Explain spool.
What is scope of pl sql developer in future?
how to create a new table by selecting rows from another table in mysql? : Sql dba
What is sql*loader and what is it used for?
what are the advantages a stored procedure? : Sql dba
Why commit is not used in triggers?