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

Where can I learn sql for free?

987


what is subquery? : Sql dba

1135


what does the t-sql command ident_current does? : Transact sql

982


What is primary key and foreign key with example?

932


Explain how to use transactions efficiently : transact sql

980


What are the properties of a transaction?

1128


When is the update_statistics command used?

1120


Is sql a dbms?

1014


How many scalar data types are supported in pl/sql?

1057


What is procedure and function in sql?

1001


How do I remove all records from a table?

1075


What is a sql instance vs database?

1117


What does dml mean?

988


Does oracle roll back the transaction on an error?

1013


What is an example of translating a date into julian format?

1124