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 / gnreddy

try this one.
select * from emp where 3 >( select count(1) from emp e where e.rowid > emp.rowid);

Is This Answer Correct ?    7 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which software is used for pl sql programming?

928


how to enter binary numbers in sql statements? : Sql dba

921


What is pl sql architecture?

919


what are the differences between binary and varbinary? : Sql dba

976


How to execute a stored procedure?

1026


What does count (*) do in sql?

951


how to load data files into tables with 'mysqlimport'? : Sql dba

1031


How do you use a while loop in pl sql?

939


Explain ddl statements in pl/sql?

957


How do I edit a stored procedure?

945


Is pl sql different from sql?

931


Name three sql operations that perform a sort.

957


How do I view a sql database?

978


What are three advantages to using sql?

958


What is sqlerrd?

918