Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to retrieve last tree records from table?
select *from emp where rownum > (select count(*)-3 from
emp);
i am using this query to get last three records from table
but its not giving any output, so please tell me what is the
error in this query.

Answer Posted / alok narayan

select * from (select * from emp order by rowid desc )
where rownum <= 3 order by rowid;

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql lookup?

913


How do I run a sql query?

1009


Why commit is not used in triggers?

1033


what is the difference between ereg_replace() and eregi_replace()? : Sql dba

1140


What is sqlite format?

1185


Explain how you can copy a file to file content and file to pl/sql table in advance pl/sql?

1004


Which is better varchar or nvarchar?

990


explain the advantages and disadvantages of stored procedure? : Sql dba

1001


What is trigger types in sql?

983


what are aggregate and scalar functions? : Sql dba

1051


What is difference between db2 and sql?

993


What is pl sql collection?

955


What are the query optimization techniques?

927


How do I count rows in sql?

996


How does sql*loader handles newline characters in a record? : aql loader

1038