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

How to write date and time literals in oracle?

547


What is Java Pool in Oracle?

596


ur a sql devoloper...what is the process in ur company for finding the database BUGS .. seperate DB testers are there? or devr.s are manage? if DB TESTERS in there what is the process

1739


What is difference between sid and service name in oracle?

507


How to specify default values in insert statement using oracle?

550






How many categories of data types?

570


When system tablespace is created?

592


In XIR2 if we lost the administration password .How can we regain the password?thanks in advance.

1464


Using the relations and the rules set out in the notes under each relation, write table create statements for the relations EMPLOYEE, FIRE and DESPATCH. You should aim to provide each constraint with a formal name, for example table_column_pk.

1348


what is the scripts in data base?

1596


Give the various exception types.

538


Can we write insert statement in function in oracle?

524


Why is oracle database so popular?

557


What is catalog in Oracle?

632


What happens if the imported table already exists?

541