Hi Everyone,
How to get fist and last record from a table in oracle?

Thanks in advance

Answer Posted / rajesh venati

this will also work

select * from table_name where rowid=(select min(rowid) from
table_name)
union
select * from table_name where rowid=(select max(rowid) from
table_name);

Is This Answer Correct ?    23 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How sql query is executed?

569


Can 2 queries be executed simultaneously in a distributed database system?

655


How to Execute a Package in PL/SQL.?

601


What is partition by in sql?

578


How delete all data from all tables in sql?

546






What are commit, rollback, and savepoint?

578


Mention what pl/sql package consists of?

549


What is difference between db2 and sql?

541


How many types of literals are available in pl sql?

526


Why join is faster than subquery?

615


Enlist some predefined exceptions?

600


How do I add a primary key to a table?

552


i have some prob lem to tell me about my self in interview first round ...

1715


Why stored procedure is faster than query?

523


Why use stored procedures?

584