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 call a javascript function from pl sql?

1071


what are the advantages a stored procedure? : Sql dba

926


what is a table in a database ? : Sql dba

991


what is a trigger? : Sql dba

976


Can you have more than one key in a database?

893


How to use transactions efficiently : transact sql

993


What plvcmt and plvrb does in pl/sql?

1251


Why do we use joins in sql?

911


How do I tune a sql query?

936


Can function return multiple values in sql?

988


describe transaction-safe table types in mysql : sql dba

946


what are the differences between require and include, include_once and require_once? : Sql dba

972


Enlist the characteristics of pl/sql?

1744


How do you pronounce sql?

957


How can you load multi line records? : aql loader

1022