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
What packages are available to pl/sql developers?
The in operator may be used if you know the exact value you want to return for at least one of the columns.
Is sql sequential or random?
Why query optimization is needed?
How do I tune a sql query?
what is sub-query? : Transact sql
What is the use of count (*) in sql?
What is materialized view. What are different methods of refresh?
Are stored procedures faster than queries?
Explain normalization and what are the advantages of it?
Is ms sql traffic encrypted?
what is the difference between delete and truncate statement in sql? : Sql dba
Is sql easier than java?
Is it possible to include an insert statement on the same table to which the trigger is assigned?
What is trigger explain it?