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 / ravi singh

select * from table_name
where rownum = 1
union
select * from table_name
where rownum > (select (count(1) - 1) from table_name);

I think this should work. try

Is This Answer Correct ?    3 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is sql? : Sql dba

1030


Can you have more than one key in a database?

937


What is sql engine in oracle?

991


Is id a reserved word in sql?

1145


Which language is used in sql?

1060


What is a parameter query?

1084


What is dml with example?

1089


how to calculate expressions with sql statements? : Sql dba

1034


what is error ora-03113: end-of-file on communication channel?

1165


What is rank () in sql?

942


Write the alter statement to enable all the triggers on the t.students table.

1125


How do you know if a relationship is 2nf?

946


what is cross join? : Sql dba

997


How to fetch values from testtable1 that are not in testtable2 without using not keyword?

1223


Why do we use cursors?

990