Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What's the procedure?

986


Does pl/sql support create command?

1168


Difference between table function and pipelined function?

1082


Define a temp table?

1082


Where is all the data on the internet stored?

1062


How many types of primary keys are there?

1082


What is sql lookup?

978


what are the type of locks ? : Sql dba

1010


What is schema in sql example?

1282


how can we know the count/number of elements of an array? : Sql dba

1109


What is application trigger?

1056


What does desc stand for?

1125


what are the different index configurations a table can have? : Sql dba

1050


What is use of term?

1130


What is difference between db2 and sql?

1048