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

SELECT * FROM
(
SELECT * FROM Emp
ORDER BY ROWNUM DESC
)
WHERE ROWNUM <= 3;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many tables can a sql database have?

1027


what is not null constraint? : Sql dba

1076


What is input buffer in sql*plus?

1292


What is program debugging?

1342


What is the unique index?

1108


how do you tune the slow running queries in oracle db , explain the methodology

3221


Can we declare a column having number data type and its scale is larger than pricesionex: column_name number(10,100),column_name numbaer(10,-84)

1008


What is memory optimized table?

1086


What is pl sql commands?

1094


What are the types of variables use in pl sql?

1089


What are pl/sql cursors?

1099


What is the command used to fetch the first 5 characters of a string?

1257


What is substitution variable in pl sql?

1107


What is the use of function in sql?

1149


what are the differences between char and varchar? : Sql dba

1115