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

Which type of cursor is used to execute the dml statement?

946


Define the select into statement.

1044


Explain the savepoint statement.

1088


what is the difference between $message and $$message? : Sql dba

991


What is the function that is used to transfer a pl/sql table log to a database table?

1001


how are mysql timestamps seen to a user? : Sql dba

1123


What are inner outer left and right joins in sql?

1006


What is hibernate and its relation to sql?

1114


What are pl/sql cursor exceptions?

1090


Can a commit statement be executed as part of a trigger?

1043


Where is pl sql used?

948


Can we use views in stored procedure?

1028


How long it takes to learn pl sql?

1003


What are triggers in sql?

1014


I need a function for a train ticket reservation please answer it thanks in advance

1018