Answer Posted / ramesh mopuri
okay above queries are fine
but in a table there are 99 salaries, so i want to pick the
50th highest salary is it possible to wright the query same
above for the get 50th high salary. absolutely not. see my
query for the get Nth salary in a table.
Select ename,sal,deptno from emp a
where &n=
(select count(distinct(sal))from emp b
where a.sal<=b.sal)
order by deptno;
after enter this query the system ask N value and give 50
the result will be shown 50th highest salary. Please reply
me whether its working or not.
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What is system global area (sga) in oracle?
I just want to maintain data like an employee can belongs to 3 or more departments . We can resolve this by using composite key but it avoids normalization rules. So Can anyone tell me how can I maintain data.
What is a trigger oracle?
Using the relations and the rules set out in the notes under each relation, write statements to create the two sequence generators specified in the notes.
Select all the employees who were hired in last 2 years and who works in dept where max managers are working.
Differentiate between translate and replace?
What are the arithmetic operations?
How to use regular expression in pattern match conditions in oracle?
What is an oracle user role?
What is parameterized cursor in oracle?
How to export data to a csv file?
does the query needs a hint to access a materialized view?
Name the three major set of files on disk that compose a database in Oracle?
What happens if recursive calls get out of control?
How to update values in a table in oracle?