How to retrieve first and last records from a table?

Answer Posted / girija.112

select *
from employees
where rowid = (select max(rowid)
from employees)
or rowid =(select min(rowid)
from employees)

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to use values from other tables in update statements using oracle?

568


Explain an index?

658


What is an Oracle Instance?

687


Can a formula column be obtained through a select statement ?

1845


How to create a table in a specific tablespace?

543






How to display employee records who gets more salary than the average salary in the department?

599


Differentiate between function and procedure in oracle.

561


I have a parent program and a child program. I want to write a statement in Exception Block of the parent program so that when the statement in the exception block is executed, the control goes to the next statement in the parent block bypassing the child block.How do i do that?

1976


How to define a data source name (dsn) in odbc manager?

529


From the following identify the non schema object: packages, triggers, public synonyms, tables and indexes.

592


Hi Can any one tell me what are the API's used in requisition import.

1490


What is difference between sid and service name in oracle?

519


What would you do with an in-doubt distributed transaction?

1470


How to define a variable to match a table column data type?

580


Explain self joins in oracle?

564