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 union?

1143


What does pl sql stand for?

1100


Can sql developer connect to db2?

1018


Can you do multiple joins in sql?

1023


what is the maximum length of a table name, database name, and fieldname in mysql? : Sql dba

1113


Explain cursor types?

1006


How does left join work in sql?

987


What operators deal with null?

1090


What is the main reason behind using an index?

1003


What does sign mean sql?

1077


Define union, minus, union all, intersect ?

988


What are the different operators available in sql?

987


How to return an array from java to pl/sql?

1116


What is sql performance tuning?

906


Does mysql_real_escape_string prevent sql injection?

940