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

Answer Posted / prabhudatta

SELECT * FROM (SELECT * FROM EMP ORDER BY EMP_NO) WHERE
ROWNUM=1

UNION

SELECT * FROM (SELECT * FROM EMP ORDER BY EMP_NO DESC)
WHERE ROWNUM=1;

Is This Answer Correct ?    14 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the different normalization forms?

583


How to revoke create session privilege from a user in oracle?

548


what happened to the global index when I truncate the data in one of the partition?

1511


What are oracle functions?

544


What is tns name?

535






How to use subqueries with the in operator using oracle?

600


How to add another datafile to a tablespace?

570


What is a subquery in oracle?

574


HI Friends Myself Manoj,i am from bengaluru.i have 1 yr of exp in PLSQL but not upto the mark..now attending interviews but m not able to clear even 1 round..i have attended 3 interviews till today.purpose of writing this query is,i want to know the intreview topics that interviewer going to ask frequently,mainly SCENARIO based questions.IF anybody have any PLSQL projects please give it to me,it will helps me alot.Thanks for your patience.

983


How to run queries on external tables?

560


What is the difference between $oracle_base and $oracle_home?

576


Why is oracle used?

546


How many categories of data types?

570


How to do paging with oracle?

565


How can I see all tables in oracle?

535