473,379 Members | 1,216 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

top 5 ( or n) salaries in each department

Niy
how to get that with SQL query?
Jul 19 '05 #1
1 5526
Read the "Functions" chapter of the Oracle SQL Reference for "analytic
functions".

In Oracle 8i or higher you should write SQL like following:

select * from (
select DepName, Salary, row_number() over (partition by DepName order by
Salary desc) RK from SALARYTABLE
) where RK<=5

"Niy" <ni***@hotmail.com> wrote in message
news:55**************************@posting.google.c om...
how to get that with SQL query?

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David Melby | last post by:
Currently the department in our company has two sections, the mainframe programmers and the "PC Programmers." That was fine when we were developing stand-alone apps using foxpro for dos. Now we...
80
by: | last post by:
Is there a performance difference between this: \\\ Dim i As Integer For i = 0 to myObject.Controls.Count - 1 myObject.Controls(i) = ... Next /// and this:
3
by: janet | last post by:
hi I want to extract one row from each range data. For example , we had table had following data name age department janet 22 HR John 45 IT Jane 25 IT
4
by: Joe User | last post by:
Hi all....I have a feeling this is going to be one of those twisted query questions, but here it goes anyways.... I want to generate a report that shows the chronology of events (represented by...
2
by: Angel | last post by:
I'm in the process of working on a Windows payroll application but I wanted some help on what design pattern I should use. For example, if my main Form needs all active employees in the DB, I'd...
0
by: Richard | last post by:
Is this possible? Here's my scenario: I have a report that presents mailed items and the events that occor for each item. First row shows the address and package information in bold. The rows...
0
by: abbaskhan | last post by:
i need to know (%) percentage or rate of each department sahring salary from the total salary eg total salary is 1000 dept a=200 dept b=350 and dept c=450 eg (then 200/(1000)*100=20%) ...
1
by: kazper | last post by:
Good day to all, I would like to ask for your expertise regarding putting numbers for each item for each group on my report (Visual Basic 6) Example of report HR Department No. ...
3
by: Suneelhema | last post by:
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 ...
1
by: simonyong | last post by:
hello, everyone Sorry for disturb.. im newbie to asp.net im trying to do a task that as below: In a SAME datagrid, it ll show all data when user key in key word in textbox... datagrid will...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
0
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.