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's the procedure?
Does pl/sql support create command?
Difference between table function and pipelined function?
Define a temp table?
Where is all the data on the internet stored?
How many types of primary keys are there?
What is sql lookup?
what are the type of locks ? : Sql dba
What is schema in sql example?
how can we know the count/number of elements of an array? : Sql dba
What is application trigger?
What does desc stand for?
what are the different index configurations a table can have? : Sql dba
What is use of term?
What is difference between db2 and sql?