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 / mah6326955

SELECT empno
FROM (SELECT ROWNUM r, emp_code
FROM emp
ORDER BY empno DESC) t1
WHERE t1.r <= 3

Is This Answer Correct ?    9 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the significance of the & and && operators in pl sql.

1046


What is user defined functions?

1028


Is trigger a stored procedure?

982


what happens when the column is set to auto increment and you reach the maximum value for that table? : Sql dba

1076


What is the difference between database trigger and stored procedure?

1136


Can we insert data into materialized view?

990


How do you change a value in sql?

1064


What is the file extension for sql database?

1062


List the various privileges that a user can grant to another user?

1091


What is sql*loader and what is it used for? : aql loader

1249


What is the most important ddl statements in sql are?

1042


What is the use of primary key?

1047


What is a left join?

1006


What has stored procedures in sql?

1101


What is autocommit sql?

1042