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 / alok narayan

Rownum assigned at the runtime on the basis of rownum you
not fetch last three records.

for no records output: Rownum always use <= or >= , if use
rownum < or > its giving no output.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How sql query is executed?

1127


Do we need commit after truncate?

1072


What is a scalar value in sql?

1070


name 3 ways to get an accurate count of the number of records in a table? : Sql dba

1061


how to delete an existing column in a table? : Sql dba

1004


what is a composite key ? : Sql dba

1045


Can I create table without primary key?

993


What is user defined functions?

962


Explain scalar functions in sql?

1059


What are sql indexes?

992


Why do we need pl sql?

969


What is string data type in sql?

1135


How is use pl and sql?

1057


What is dbo in sql?

953


Can we join tables without foreign key?

955