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

How do I remove sql plus from windows 10?

1096


What is difference between hql and sql?

1077


What is trigger with example?

1097


What is difference between joins and union?

1124


How many databases can sql express handle?

984


Compare sql & pl/sql

1137


What are the different type of joins in sql?

954


what is a constraint? : Sql dba

1166


What are the two different parts of the pl/sql packages?

1087


What is the difference between microsoft access and sql?

1023


What is pl sql in oracle?

1041


What are the built in functions of sql?

1030


Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql

984


What is oracle sql called?

922


What is a primary key example?

956