How do you retrieve the last N records from a table?

Answer Posted / kiran penujuri

This Will give you last 10 records from a table

SELECT EMPNAME,SALARY
FROM
(SELECT EMPNAME,
SALARY,
RANK() OVER(ORDER BY SALARY) SAL_RANK
FROM EMP)
WHERE SAL_RANK < = 10

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does a covering index work?

520


Define tables and fields in a database

640


How do I view stored procedures?

534


What are the different sql languages?

533


Is clustered index a primary key?

520






Explain the select statement in sql?

609


What is character functions?

551


What is a trigger word?

509


What is the difference between delete, truncate and drop command?

543


What is the difference between syntax error and runtime error?

609


What is a table partition?

584


What are stored procedures in mysql?

553


Explain architecture of sql server notification services?

616


What are analytic functions in sql?

543


How do you concatenate in sql?

544