hi I want to know about a Query regarding Top 10 salaries from Emp and I want 1 to 10 numbers at the Regarding salaries
I want Out put like 10000 1
7500 2
5500 3
3500 4
3 1783
try to use this -
SELECT EMPNO,ENAME,SAL,DENSE_RANK() OVER (ORDER BY SAL DESC) AS RK FROM EMP ORDER BY SAL DESC
-
-
-
-
select rownum as rank ,ename,sal
-
from (select ename,sal from emp order by sal desc)
-
where rownum<=&n
-
//
-
-
SELECT min(sal)
-
FROM (SELECT sal
-
FROM emp
-
order by sal desc)
-
WHERE rownum<(&nth_heighest+1);
-
//
-
-
select ename, sal
-
from (select ename,sal,dense_rank() over(order by sal desc) dr from emp)
-
where dr = &rnk
-
//
-
-
SELECT *
-
FROM (
-
SELECT empno, ename, sal,
-
RANK() OVER (ORDER BY sal DESC) EMPRANK
-
FROM emp)
-
//
-
-
hi I want to know about a Query regarding Top 10 salaries from Emp and I want 1 to 10 numbers at the Regarding salaries
I want Out put like 10000 1
7500 2
5500 3
3500 4
-
-
SELECT salary, rn FROM
-
(SELECT empno,salary,rownum rn from emp ORDER BY salary desc) WHERE rn <= 10
-
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Niy |
last post by:
how to get that with SQL query?
|
by: Toralf Kirsten |
last post by:
Hi,
we use DB2 V8.1 on a Linux machine.
Situation: To store salary data we have designed a star schema
containing the dimension tables product, office, time and the the fact
table salaray...
|
by: --CELKO-- |
last post by:
I am getting material for a second edition of my SQL PUZZLES book
together of the next few months.
1) If anyone has a new puzzle, send it to me. You will get your name
in print, fame, glory and...
|
by: MattB |
last post by:
I've asked my employer for a raise (which of course I believe is
justified). They are asking me to provide some input and I'm looking for
a good resource(s) for what we typically make.
Any links...
|
by: Sachin |
last post by:
Hi Everybody,
I am doing a project and I desire to know can we connect SQL
database in C programs and use them ? Can any body can help me? Please
explain me the whole concept & give me the code...
|
by: IRFAN KHAN |
last post by:
HI, ItS URGENt PLZ ANSWER
|
by: Bala |
last post by:
FOR MORE DETAILS AND POST YOUR RESUMES ON
http://polticsinfs.blogspot.com/
|
by: Breezwell |
last post by:
Hi everyone,
This is a question for all of you out there who also work as Access database designers and administrators.
I know there are a lot of variables to consider when estimating your...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |