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

Answers were Sorted based on User's Feedback



Hi Everyone, How to get fist and last record from a table in oracle? Thanks in advance..

Answer / cbigmudre

(select * from table limit 0,1)
union
(select * from table order by Id desc limit 0,1)

Is This Answer Correct ?    0 Yes 3 No

Hi Everyone, How to get fist and last record from a table in oracle? Thanks in advance..

Answer / gourav

select * from employees
where employee_id=100
union
select* from employees
where employee_id=206;


Example

first coulumn_ id(100)
last column _id(206)

Is This Answer Correct ?    0 Yes 4 No

Hi Everyone, How to get fist and last record from a table in oracle? Thanks in advance..

Answer / 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

More SQL PLSQL Interview Questions

What is mutating trigger?

0 Answers  


What is out parameter used for eventhough return statement can also be used in pl/sql?

0 Answers  


What are the data types allowed in a table?

3 Answers  


Can we delete column in sql?

0 Answers  


List different type of expressions with the example.

0 Answers  


How to download oracle sql developer?

0 Answers  


what is global variable in package

3 Answers   Polaris,


table structure: ---------------- col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10 01-mar-2012 11:12:46 01-mar-2012 11:11:23 Write a query to display the result as shown below: col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10

2 Answers  


What are the advantages of VIEW?

5 Answers  


how can we destroy the cookie? : Sql dba

0 Answers  


Why is a trigger used?

0 Answers  


Explain what is a column in a table?

0 Answers  


Categories