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...

how to retrieve 1st and last row of table without using
group functions??

Answer Posted / rajesh

SELECT * FROM (SELECT * FROM EMP ORDER BY EMP_NO) WHERE
ROWNUM < 2

UNION

SELECT * FROM (SELECT * FROM EMP ORDER BY EMP_NO DESC)
WHERE ROWNUM < 2;

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is tns entry?

1127


What do you mean by merge in oracle and how can we merge two tables?

1047


What is a procedure in oracle?

1175


What happens internally when the user types userID/password@string in SQL PLUS Thanks-Bhaskar

4560


Explain about functional dependency and its relation with table design?

1001


What is the difference between translate and replace?

1053


What is blob data type in oracle?

1111


How can I combine multiple rows into a comma-delimited list in oracle?

1050


What is enter substitution variable in oracle?

1039


What are named parameters?

1085


Will you be able to store pictures in the database?explain.

988


How to connect to the server with user account: sys?

1010


How to open a cursor variable?

1028


How to update a table row with a record?

1006


How to use group functions in the select clause using oracle?

1062