How to retrieve first and last records from a table?

Answer Posted / naveen

SELECT * FROM EMP WHERE ROWID IN(SELECT MIN(ROWID) FROM EMP)
UNION ALL
SELECT * FROM EMP WHERE ROWID IN(SELECT MAX(ROWID) FROM EMP);

Is This Answer Correct ?    22 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to define a data field as not null?

629


What is literal?

584


How to select some rows from a table in oracle?

594


Difference between oracle's plus (+) notation and ansi join notation?

568


Her departmandaki isçilerden empno' su ikinci sirada olan isçilerin empno, deptno, hiredate, sira_no bigilerini döndüren sorguyu yaziniz?

1563






Name the various constraints used in oracle?

562


How to grant create session privilege to a user in oracle?

564


How to create a stored procedure in oracle?

573


Explain the use of analyse option in exp command.

584


Hi friends can u send the oracle 9i full version download link?????????????? please reply ?

1440


What is the Tune Query

1837


How to display row numbers with the records?

584


What to do if the binary spfile is wrong for the default instance?

559


Can we commit inside a function in oracle?

556


What is index in Oracle?

584