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 / bikash khuntia

select * from (
select rownum rw,bk.sal from
(select sal from TEMP_SAL order by rowid desc) bk) bik
where bik.rw<=3

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1104


What is procedure and function in sql?

1003


Why use stored procedures?

1098


Is it possible to remove child records without removing master table records...the two having pk,fk relationship?

1269


what are set operators in sql? : Sql dba

1057


how to include comments in sql statements? : Sql dba

962


how to create a test table in your mysql server? : Sql dba

1012


What's the difference between inner join and left join?

1001


What is record data type?

920


Can we rollback after truncate?

1033


what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba

1040


Why functions are used in sql?

995


What action do you have to perform before retrieving data from the next result set of a stored procedure ?

2571


What does inner join mean?

1173


How to display the current date in sql?

1082