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

What are the types of trigger in oracle?

576


Why do we need oracle client?

511


How does one get the view definition of fixed views/tables?

606


What are a cluster and non-cluster index?

576


What is oracle database client?

557






Differentiate between translate and replace?

633


How to convert csv to table in oracle?

528


How to join two tables in a single query using oracle?

566


How many types of cluster table in Oracle?

579


What are the advantages of oracle 12c?

557


What is query image?

586


What is program global area (pga) in oracle?

609


Why oracle is used?

580


Why does oracle 9i treat an empty string as null?

539


What suggestions do you have to reduce the network traffic?

549