suppose we have a table in which 200 rows. i want to find
101 row ? what the query....
and how we find 4th and 5th highest salary and 1 to 10
highest salary
Answer Posted / m.raghu
answer for 101th record
select * from emp where empno in( select decode
(rownum,&n,empno) from emp);
for 4th highest sal
select distinct sal from(select empno,dense_rank() over
(order by sal desc) rnk from emp) where rnk=&n;
for 5th highest sal give n value=5
for 1-10
select distinct sal from(select empno,dense_rank() over
(order by sal desc) rnk from emp) where rnk<=&n;
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What are the properties of a transaction?
What is pivot query?
what is sp_pkeys? : Transact sql
What is t sql used for?
what is oltp (online transaction processing)? : Sql dba
Why self join is used in sql?
Is it possible for a table to have more than one foreign key?
What is sqlcommand?
How do I create an index in word?
What is snowflake sql?
What is sql not null constraint?
First round ------------------- - Procedure - Packages - Views - Virtual tables - Can we use dcl with in function? - Joins and few scenarios - Triggers and its type - Pragma, type and its functionality - How to create db link in oracle - Materialized view - How to find duplicate values from table? - Cursor and its functionality - Write a script to display friday and its date from a entire year. - Exception Handling Second round ------------------------ Gave a scenario like. Need to write a function to perform. When user try to change a password. It must not be last five password and a given password can be combination of characters, symbols, upper and lower case.
What is a parameter query?
What does select top 1 do in sql?
What is row_number () in sql?