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

Explian rowid, rownum? What are the psoducolumns we have?

984


How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?

1119


How to rename a column in the output of sql query?

1061


Can we insert in view in sql?

1036


What is a .db file?

960


Can a trigger call a stored procedure?

1050


Does view store data in sql?

942


how to get a list of indexes of an existing table? : Sql dba

947


What are the operators used in select statements?

1041


how to increment dates by 1 in mysql? : Sql dba

959


What is the difference between microsoft access and sql?

999


What are the events on which a database trigger can be based?

1170


How to look at the current sql*plus system settings?

1134


What are sql commands?

987


What is an example of translating a date into julian format?

1096