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
Can we call stored procedure in function?
What is the file extension for sql database?
What is pl sql record in oracle?
What is prepared statement in sql?
what is innodb? : Sql dba
Determine if oracle date is on a weekend?
What is the use of desc in sql?
What is pl sql block in dbms?
How do you bind variables in pl sql?
Can a composite key be null?
What are sql ddl commands?
What is meant by truncate in sql?
What version is sql?
discuss about myisam key cache. : Sql dba
How many types of relationship are there?