get months with the maximum salary
Hello
I have the rest of the table.
create table getmax)
Select 1 empid, 2 month, 5000 in union wages double all the
Select 1 empid, 10 months, the salary of 6,000 union double all the
Select 1 empid, 12 months, 5500 in union wages double all the
Select 2 empid, 3 months, the wages of 7000 Union double all the
Select 2 empid, 7 months, the salary of 6,000 union double all the
Select 2 empid, month 12, 5500 double salary
);;
I need to get employee of the month was the highest salary.
Required result
========================
EMPID MONTHS SALARY
========================
1 10 6000
2 3 7000
=======================
Help, please.
with
getMax as
(select empid 1, 2 months, 5000 in union wages double all the)
Select 1 106 000 from all the double union
Select 1 125 500 Union double all the
Select 2,3,7000 from all the double union
Select 2,7,6000 from all the double union
Select double 2 125 500
)
Select empid, month, wages
(select empid, month, salary)
ROW_NUMBER() on rn (empid, salary desc order partition)
of getmax
)
where rn = 1
EMPID | MNTH | SALARY |
---|---|---|
1 | 10 | 6000 |
2 | 3 | 7000 |
Concerning
Etbin
Tags: Database
Similar Questions
-
How can I get the maximum salary of the first ascending
Hello
How can I get the maximum salary of the first in ascending order.
I need the sql query.
want my output:
Emp_name salary
A 5000
SS 100
300 AA
DD 700
WW 2000
Thank you
Walid.Here is an example:
SQL> with mytable as 2 ( select 'aa' as col1, 300 col2 from dual union all 3 select 'ss' as col1, 100 col2 from dual union all 4 select 'a' as col1, 5000 col2 from dual union all 5 select 'dd' as col1, 700 col2 from dual union all 6 select 'ww' as col1, 2000 col2 from dual ) 7 select col1, col2 8 from mytable 9 order by decode(row_number() over (order by col2 desc),1,0,1),col2; CO COL2 -- ---------- a 5000 ss 100 aa 300 dd 700 ww 2000 SQL>
Nicolas.
-
Select the emp with a maximum salary for each hr.emp manager_id
Hello
Can someone help me to do this without doing any partitioning or analytical f:
Select the emp with a maximum salary for each hr.emp manager_id.
HR. EMPLOYEES Table Description: =.
EMPLOYEE_ID
FIRST NAME
LAST_NAME
HIRE_DATE
JOB_ID
SALARY
COMMISSION_PCT
MANAGER_ID
DEPARTMENT_ID
TX, all the guys
MarioHi, Mario,.
Here's one way:
SELECT * FROM hr.employees WHERE (manager_id, salary) IN ( SELECT manager_id , MAX (salary) FROM hr.employees GROUP BY manager_id ) ;
mario17 wrote: Hi,
Can someone help me to do this without doing any partitioning or analytical f:Do you mean analytical functions?
Why you don't want to use the analytical functions? Analytical functions, permitting the simpler, more robust and more effective to achieve these results, wouldn't you want that? -
Last day of the month with the last minute of the day
Hello
I wonder about how to get the last day of the month with the last minute of this day(23:59). We can use the last_day function (DATE) to get the last date, but reminds me of the time of day when the function has been executed. But I want to have the last minute with my last date of the current month.
Please inform.
Thank you
HPHello
Ora_bie wrote:
Hello
I wonder about how to get the last day of the month with the last minute of this day(23:59). We can use the last_day function (DATE) to get the last date, but reminds me of the time of day when the function has been executed. But I want to have the last minute with my last date of the current month.In fact, it returns at the same time as the argument you pass; But whatever it is, is not what you want.
This will return the last day of the month that contains the DATE 23:59 (or 23:59) dt:
SELECT ADD_MONTHS ( TRUNC (dt, 'MONTH') , 1 ) - (1 / (24 * 60)) FROM dual ;
TRUNC (dt, 'MONTH') is 00:00 on the first day of the month that contains dt.
ADD_MONTHS (TRUNC (dt, 'MONTH'), 1) is from 00:00 the first day of the month following the one containing dt.
ADD_MONTHS (TRUNC (dt, 'MONTH'), 1)-(1 / (24 * 60)) is a minute earlier.
(Since there are 24 hours, each with 60 minutes, every day, 1 / (24 * 60) days is identical to a minute.)Another (less clear, in my opinion) way to get the same results is:
TRUNC (LAST_DAY (dt)) + (1439/1440) -- 1440 minutes = 1 day
-
Why do I get problems with the challenges of poker Facebook poker?
Why do I get problems with the challenges on facebook poker? have reloaded JAVA.didn't work
URL of affected sites
http://
I'm not sure what that requires the application of poker, but perhaps solutions in the article of problems with some Facebook games, cat and more will help
-
Is there a problem with the maximum size of the RAM for Satellite 320CDT?
I have a 320CDT Satellite with the latest BIOS (v8.00) and Windows 98 Second edition installed. There are 32MB memory base and a 32 MB module in the single expansion slot. If I change it to a plug-in 64 MB I see that 64 MB of total memory reported, not 96 as expected; the specification for the machine indicates that the admissible maximum memory is 160 MB (32 MB base + 128MB expansion). Does anyone know if there is a problem with the maximum memory size for this model and if there is a solution or workaround? I need to know quickly, in order to decide if I should return the memory module to the vendor! Thanks a lot for any help, Peter
Satellite 320CDT supports an internal memory of 32 MB and a single slot can be used!
You can improve it to max 96 MB (32 + 64 MB)
I found a few old memory modules. You can use the modules SODIMM 144 pin EDO PA2043U 32 MB or 64 MB PA2044UGreetings
-
Hello, I recently built a computer and installed all the software, drivers and updates of windows that I needed. Go and try to play games, I can play for a little bit. Then my computer crashes or I get BSOD with the error Stop: 0x000000F4. Generally before that happens, Skype will plant give me a message that says "error disk i/o" If that helps. How can I fix this problem so that this error does not happen again? It happened several times. I tried to reinstall the CMOS battery on the motherboard. I have the latest firmware of my SSD and drivers for my card mother and graphics card. My specs are:
Windows 7 x 64
I7 - 4770 k
ASUS Z87 - a
Corsair Vengeance 8 GB 1600 Mhz
Modular power supply Corsair HX750
Liquid chillers H80i Corsair
EVGA GTX Superclocked 760 ACX
Samsung 840 120 GB SSD (boot disk; the games installed on it)Hello
To help you, we will need files DMP to analyze what exactly happened at the time of the accident, etc.
If you don't know where the DMP files, here's how to get to them:
1. go to the Windows\Minidump folder.
2 copy all the DMP files in the Minidump folder on your desktop and zip then those files.
3 download the zip containing the files DMP to Skydrive or a Web hosting of your choice and paste in your answer.If you plan to use Skydrive, but do not know how to download it, please see the following:
http://www.WikiHow.com/use-SkyDrivePlease note that all "cleaner" such as TuneUp Utilities, CCleaner, etc., default will remove files DMP when using because of their place too.
If your computer doesn't generate DMP files, follow these steps:
1. start > type systemroot which should show the Windows folder, click it. Once inside this folder, make sure there is a Minidump folder created. If not, CTRL-SHIFT-N to create a new folder and name it Minidump.
2. Windows key + key Pause. This should appear in the system. Click Advanced on the left system settings > advanced > performance > settings > advanced > make sure there is a check mark for "manage automatically the size of pagefile for all readers."
3. Windows key + key Pause. This should appear in the system. Click Advanced on the left system settings > advanced > startup and Recovery > settings > failure > ensure there is a check mark next to "Write an event to the system log" > make sure that "automatically reboot" is unchecked.
Ensure that the partial memory image is turned on and make sure the path is % SystemRoot%\Minidump.
4. check that the viewers is ENABLED:
Start > Search > type services.msc > on the name tab, search for Windows Error Reporting Service > if the service status is not started, then right-click and select start. Also to ensure that, under Startup Type set to automatic rather than manual. You can do this by right click, select properties and under general selection on 'Automatic' startup type and then click on apply.
If you can not get into normal mode to do this, please do so via Safe Mode.
Kind regards
Patrick
-
am I right to assume that the same reason, my windows 7 OS crashed & had to be re-installed seven times in nine months with the losse of precious files is the same reason that microsoft has been duffed the international space station?
Hello
If I understand correctly you install os 7 times, still problem happens, its just a bad sector in plateau, well shot cause want to check your hard drive a d, you need to change your hard drive to solve this problem, if it is in warranty log a ticket
-
How many photos can I create and edit per month with the $9.99 plan?
I was wondering if there was no limitation on the number of projects I can do in a month with the $9.99 plan
Hi crisr27764025,
There is no limit to the number of photos.
You can change as many photos/projects using Lightroom and Photoshop you want (with the $9.99 plan)
-
I can't get contact with the cloud
I can't get contact with the cloud. The icon on my desktop is black and the wheel turn and turn and turn. What should I do?
OK, great, I hope that the link of this thread (shown below) helps you then your situation. App does not open. Wheel of progress turn continuously
http://helpx.Adobe.com/creative-cloud/KB/unknown-Server-Error-launching-cc.html
Keep us informed.
-
Service request not getting associated with the Contact
Hello
We have an interface between the Web site of our company and Siebel On demand application, visitors can come to our Web site and submit a request by filling out a form with their contact information and their request. In turn, this creates a folder 'Contact' and a 'Request for Service' in the Application folder,
'Contact', we used WSDL and v2.0 "Request for Service" WSDL as the webservice interface, we find that the Contacts and requests for services are created as that individual records, service demand does not get associated with the contact record is created?
We are capture the following information under the heading "Contact".
First name:
First name:
E-mail:
Phone:
Address:
and the following information under the 'Service request'
Product information:
Object:
Description:
Type:
Status:
Should the specify us anything else under the Service request in the interface that will associate the Contact and "demand for services.
Is it because in version 2.0, each object exist as separate nodes that we are facing this problem?
This will be solved by using v1.0, is there a limitation any using v1.0, please specify
You can call me if you need additional information
Thanks and greetings
Satish Kumar
+ 1-857-869-0239Hello
When you create the Service request, make sure that you set the field "ContactId" so that the created contact is associated with the SR created.
-John CRMIT
-
I get BSOD with the key USB TV Tuner PX1211E-1TVD
Hi all
I just bought the model tuner TV USB Toshiba px1211e-1tvd and whenever I turn it on I get a blue screen error on my hp Pavilion dv6821el pc... dv6000 series.
I tried to update the BIOS and the driver of my pc's display, but without results...
The USB device is properly installed and the program (savvy tv) included with the cd as well, but I still get the Blue error screen...
The operating system is Windows Vista...What can you suggest me to do folks?
Please... I need help :-(
Hello
The BSOD appears usually due to a hardware problem problem or software commutabilite.
I think in your case it s a software problem and I recommend updating the driver.The new driver could be found on the European driver Toshiba page in the Options area.
On the driver page choose this:* Options-> Office Accessories based-> tuner TV USB hybrid TV Tuner Windows Vista 32 bit *.
There you can find Savvy TV driver.
-
HTTP GET method with the body of the message
Hi all
I work with an API using HTTP to make calls to a server. I met an API call in the documetnation that uses the HTTP GET method with a message body. It seems that this is not supported by LV14 because I do not see an entry of message body for the LabVIEWHTTPClient.lvlib:GET.vi function. The POST methods and COULD appear to be banned for this API call, I a not found 405. I could be stuck with the help of GET.
Certainly, this isn't recommended GET method - but it is not explicitly forbidden in the HTTP/1.1 specification. Is there a work around to submit an HTTP GET request to content? I have to use HTTP external DLL to achieve?
All entries would be great.
Thank you
Richard
Seems to be a problem on the server side? Maybe I misunderstood what you were trying to get?
-
Get lost with the controls on the panels
Hi all,
With the help of Lavwindows 2010
I have a little difficulty with my UIR. I inherited a project with several panels, 2 have about 340 controls on each of them, I'm looking at (for example) a certain (RATE) control properties. I use the tree Panel to get the table I want and the FREQUENCY control. I double click on the name of the control RATE. In the details (under the tree Panel) section, it shows the name of the constant is MLED_MAX12_2 and its status led (its really a digital slide).
Is it just that CVI has trouble with panels containing a large amount of controls?
Is there another way for me to access this control? (right click on RATE and by selecting OBJECT UI FIND gives me the properties of the control MLED_MAX12_2.
Is there a limit to the number of controls on a Panel? of the project? File of the UIR?
Thank you
Pete Hedlund
I couldn't reproduce it in 2010 SP1, so I tried in 2010, and I could reproduce the bug. This problem has been fixed in 2010 SP1.
http://zone.NI.com/DevZone/CDA/tut/p/ID/12323#290057_by_Category
The solution is to change the control in the edit control dialog box that appears when you click on
, when a control has focus in the editor the user interface with the editing tool selected (as opposed to the tool of exploitation). Or you can double-click the control to display the edit control dialog box. -
Registration and getting started with the INK HP INSTANT
Registration and getting started with ink HP Instant
Note: your printer must be connected to the Internet via a wireless connection.
How does that you will always have ink HP? Your printer uses Internet to let us know when to send more ink. Here's how you can get all the ink you need, delivered to your door.
- Buy an eligible printer.
- Enroll in a plan based on the number of pages you print.Ink, cartridge recycling and transport are included.
No annual fee, change or cancel your plan anytime.3 - We'll will ship special HP Instant cartridges.Our cartridges have more ink than the standard HP ink cartridges, so you'll replace them less often.
- Billing service and begin after inserting your first instant HP ink cartridge.
- Your printer will tell us when to send handwritten entry.Your service is not based on how many cartridges you use, so print as many pictures of high quality that you want.
- You will always have ink before you need it.
LoneStarBob wrote:
I received my first ink (three colors) of HP cartridge. check the two original instant of ink in the printer cartridges they show two 3/4 full (identical). Puzzeld just why black not sent.
Hi LoneStarBob,
I'm going to private msg you on it to help track.
Thank you
Ciara
Maybe you are looking for
-
Theme font size changer, I downloaded but it won't install
I use Thunderbird on a laptop running Windows 7. I want to increase the size of the text in the Inbox and other folders. I downloaded the theme font size changer add to my desktop but I don't get an option to install in Thunderbird. Can you help me?
-
I can't find one for a g7 Pavilion windows 7 64-bit pci device. I got the rest of the downloaded drivers and that's the last of them in need. hardware ID is PCI\VEN_10EC & DEV_5229 & SUBSYS_184B103C & REV_01 PCI\VEN_10EC & DEV_5229 & SUBSYS_184B103C
-
What is the equivalent of 4 FF to IE 8 Accelerator?
In IE 8, I could choose a countdown of the text, then right click and search on this text with a list of several search engines, like Google. How I would do this in 4 FF? Please answer. TIA
-
Assessment method regarddu or ByValue
In the Stimulus Profile Editor (VS2011), parameters can be either selected with the method of assessment being 'simple' or 'byValue. What does it mean and where is there any documentation to this? L.
-
Windows XP cannot get the speakers to work
I moved my computer and when I put it up I have no sound on my speakers. Receive automatic updates, this could be the problem? and if so, how do I do?