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

Hi,
First thing you cannot use " ROWNUM > (somthing) "
And to get last three records...

Select *from emp
minus
Select *from emp where rownum <(select Count(*) from emp)-
3;

Good Luck...

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is database migration?

913


Explain architecture of sql server notification services?

985


What are the two types of exceptions in pl/sql?

965


What normalization means?

905


What is a sql schema used for?

1027


Explain the difference between triggers and constraints?

920


Why truncate is used in sql?

936


Can we insert data in view?

888


How much does sql cost?

930


What are procedures used for?

922


What is cross join example?

941


what is the difference between undefined value and null value? : Sql dba

1038


Can I create table without primary key?

938


What is sql deadlock?

1048


Which join is default?

897