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

How to combine two stored procedures in sql?

1242


what is heap table? : Sql dba

1108


What are the different schemas objects that can be created using pl/sql?

1037


Does sql*plus also have a pl/sql engine?

1083


Can we call a function containing dml statements in a select query?

988


What are basic techniques of indexing?

1388


How much does sqlite cost?

1047


Explain what is rdbms?

1045


How do you delete a table?

1083


Can we insert delete data in view?

954


What is pl sql in oracle?

1047


What are sql data types?

1034


what are date and time data types in mysql? : Sql dba

977


What are sql*plus environment variables?

1099


Why we use pl sql?

964