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

SELECT empno
FROM (SELECT ROWNUM r, emp_code
FROM emp
ORDER BY empno DESC) t1
WHERE t1.r <= 3

Is This Answer Correct ?    9 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between truncate and drop statements?

1172


Where do we use pl sql?

991


what is a foreign key ? : Sql dba

1073


What is the difference between sum and count in sql?

981


When is the explicit cursor used ?

1023


How do I run a pl sql procedure in sql developer?

962


What is rank dense_rank and partition in sql?

1021


Can you sum a count in sql?

991


What are % type and % rowtype?

1026


Is it possible to create the following trigger: before or after update trigger for each row?

1276


write an sql query to get third maximum salary of an employee from a table named employee_table. : Sql dba

963


what is rollback? : Sql dba

1095


How do I edit a trigger in sql developer?

986


define sql update statement ? : Sql dba

1109


What is the difference between an inner and outer join?

1006