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 are the parts of a basic sql query?

938


What is varchar used for?

1042


Should I use mbr or gpt?

971


What is int identity in sql?

1081


What is difference between rank () row_number () and dense_rank () in sql?

1065


How do you take the union of two tables in sql?

953


Can we call stored procedure in function?

918


What are the different tcl commands in sql?

1123


What is the difference between sql and t sql?

987


What is a schema? How is it useful in sql servers?

1057


what is bcp? When is it used?

1065


How do I copy a table in sql?

948


which command using query analyzer will give you the version of sql server and operating system? : Sql dba

1012


Write a unique difference between a function and a stored procedure.

948


How do you explain an index number?

1052