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

What is #table in sql?

1087


Which software is used for pl sql programming?

982


What is before trigger?

999


How do you declare a variable in pl sql?

1019


what are the nonstandard string types? : Sql dba

1134


How is data stored in sql?

1051


Is it mandatory for the primary key to be given a value when a new record is inserted?

1196


what is myisam? : Sql dba

1073


What is dense_rank in sql?

976


How can we make an if statement within a select statement?

1006


Is sql easier than java?

1004


What is rename command in sql?

1026


What is the default isolation level in sql server? : Transact sql

1020


When should I use nosql database?

1003


Which is better varchar or nvarchar?

992