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

Why cannot I use bind variables in ddl/scl statements in dynamic sql?

1209


how to create a new view in mysql? : Sql dba

938


Does sql*plus have a pl/sql engine?

1075


Can we use having without group by in sql?

982


differentiate between float and double. : Sql dba

1060


What does the hierarchical profiler does?

1058


What is scope and visibility in PL/SQL?

1204


What does pl sql stand for?

1117


What is informix sql?

979


What are the types of functions in sql?

1020


What sql does db2 use?

983


What is a temporal table?

930


How many types of functions are there in sql?

955


Is clustered index a primary key?

949


What are two statement types in sql?

1107