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

Can we call stored procedure in function?

905


What is the file extension for sql database?

939


What is pl sql record in oracle?

971


What is prepared statement in sql?

997


what is innodb? : Sql dba

1034


Determine if oracle date is on a weekend?

984


What is the use of desc in sql?

916


What is pl sql block in dbms?

952


How do you bind variables in pl sql?

1036


Can a composite key be null?

912


What are sql ddl commands?

1020


What is meant by truncate in sql?

1008


What version is sql?

966


discuss about myisam key cache. : Sql dba

976


How many types of relationship are there?

976