Job and salary for that job based on the department!!!

Please, can somebody help me with this. I'm facing some challenges getting the required result with my queries.
Here's what am trying to do:
A query to display the job, the salary for that job based on the department number, and the total salary for that job, for departments 20, 50, 80, 90, assuming the schema in use is the hr schema. The job should be distinct, no duplicates.
Thank you for your anticipated answers.
I really appreciate your replies in advance.
T.O

846641 wrote:
Please, can somebody help me with this. I'm facing some challenges getting the required result with my queries.
Here's what am trying to do:
A query to display the job, the salary for that job based on the department number, and the total salary for that job,What do you mean by "the salary for that job"? It sounds like you want something besides the total salary (which is what the SUM function provides). What is that other something? The avgerage salary (that would be the AVG function)? The smallest salaary (MIN)? The biggest salary (MAX)? The number of rows that have a salary (COUNT)? If you can explain what you want, someone will help you get it.
for departments 20, 50, 80, 90, assuming the schema in use is the hr schema. The job should be distinct, no duplicates.GROUP BY automatically gets distinct results for each of the GROUP BY expresssions, so there's no need to say SELECT DISTINCT . The previous solution could be better written as:
SELECT    job_id
,       SUM (salary)     AS total_salry
,       department_id
FROM       hr.employees
WHERE       department_id     IN (20, 50, 80, 90)
GROUP BY  department_id
,            job_id
ORDER BY  department_id
,            job_id
;The output that this produces from the Oracle-supplied hr.employees table is:
JOB_ID     TOTAL_SALRY DEPARTMENT_ID
MK_MAN           13000            20
MK_REP            6000            20
SH_CLERK         64300            50
ST_CLERK         55700            50
ST_MAN           36400            50
SA_MAN           61000            80
SA_REP          243500            80
AD_PRES          24000            90
AD_VP            34000            90I hope that's what you wanted.
If not, post the results you do want from this same table. Explain how you get those results.
Always say which version of Oracle you're using. It might not matter in this case, but why take a chance?

Similar Messages

  • Sql agent jobs based on the database and the user

    Dear All,
    I have a requirement of configuring an user who should only have access to one database out of all and also able to create, view and modify sql agent jobs only for the allowed database. For allowing to see the selected database to particular user I have
    granted permissions as per below,
    create LOGIN mhtc WITH PASSWORD='mhtc', CHECK_POLICY = OFF;
    USE master;
    GO
    DENY VIEW ANY DATABASE TO mhtc;
    USE master;
    GO
    ALTER AUTHORIZATION ON DATABASE::MHTC TO mhtc;
    GO
    but user not able to see sql agent jobs so I want to give necessary permission to this user to view,create and modify sql agent jobs only in allowed databases. Basically I want to separate users from each database and separate sql agent jobs based on the
    user and database.
    Your expert advices are highly appreciated.
    Thanks,
    Manjula

    I want to give necessary permission to this user to view,create and modify
    sql agent jobs only in allowed databases.
    Hello Manjula,
    SQL Server Agent Jobs are not created / dedicated for a user database. The Jobs are store in System database "msdb".
    See
    Implement SQL Server Agent Security for Details about required permissions.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • II am looking for information on iPad and iPhone apps and Mac software that are "top of the line" for academic research. The most current and comprehensive information I have found is dated July 2010.

    I am looking for information on iPad and iPhone apps and Mac software that are "top of the line" for academic research. The most current and comprehensive information I have found is dated July 2010.

    PogoPossum,
    My area of interest is in business and economic history. There is a considerable amount of reading and charting. Until the iPad hit the streets, I only considered stacks of books, journals, and downloaded documents, all marked up with highlighters, underlines, and marginal notes.
    Most of my PC based work involved MS Office, Endnote, and MS OneNote.
    What I would like to do with the iPad and MacBook are the same things (Office, Endnote, OneNote) and add the ability to read and markup all forms of printed materials from books to pdf to webpages.
    I cut my teeth on an iPod Touch and have tried a lot of the note taking and reading apps. Without a camera the standard iPod Notes works for short quick notes and long think pieces. I just emailed the content and downloaded the stuff to my PC. Obviously, I do not want to continue at this "non-integrated" level of work.
    Does this help?
    Dick

  • I created an Apple ID for iTunes using a work email address and left that company before I had an opportunity to change the email and password for that account.  How do I change the email address to a new one that I can access?

    I created an Apple ID for iTunes using a work email address and left that company before I had an opportunity to change the email and password for that same account.  Now I can't seem to login to that account and I can't choose the option for forgot password because it will send email to the old workplace.  How do I change the email address to a new one that I can access?

    If you remeber the password to that Apple ID then follow these steps
    1 - Make sure you have an email address that is NOT an Apple ID
    2 - Go to AppleID.Apple.com
    3 - Where it reads Manage Apple ID - Sign in
    Once you are signed in want to make sure the email address you are wanting to use is NOT set up as a "Recovery/Rescue" email for this account.
    [To check this - Main page where you see Primary ID - below do you see the email address you want to use listed towards the bottom? Yes - Delete / No - Good ./. If made any adjustments "Save" Next on the left select "Password & Security" - Answer your security questions you set up "if you have any" then scroll towards the bottom and check to see if you see the email address you want to use. Yes - Delete / No - Good] <-> Also you can change your password on this page as well. Any adjustments made "Save"
    Once this is done go back to the main page where you should read "Primary ID" and change the email address that is showing to the new email address youo want. "Save" Done
    I learned this not to long ago and worked for me. Hope this helps you!

  • I can't remember the password I used to set up icloud nor the email I used to set it up with. I have my apple ID and email for that account.

    I recently had to do a factory restore on my iphone 4s. Upon trying to set up my phone again I am being asked to sign into my icloud account. I can't remember the password or the email I used to set it up. I know my Apple ID, password and email for that account, but that doesn't allow me to get back into my phone. I can't reset the icloud password because I can't remember the email I used. Any ideas on what I can do please ?

    Hi, Fugalltadowivu.  
    Thank you for visiting Apple Support Communities.
    This sounds like Activation Lock has been enabled on this device.  Here is some helpful information regarding this feature.
    Find My iPhone Activation Lock
    http://support.apple.com/en-us/HT201365
    If you purchased your device from a third party, this device may be locked to their Apple ID.  If this is the case you may want to check out the article below.
    Find My iPhone Activation Lock: Removing a device from a previous owner’s account
    http://support.apple.com/en-us/HT201441
    Cheers,
    Jason H.

  • TS4062 I've done all of these recommended steps.  My problem is that I have a new laptop that I am trying to sync my iPhone (and iPad for that matter) via Wi-Fi but both devices are looking for the old laptop to sync.  Any other suggestions?

    I've done all of these recommended steps.  My problem is that I have a new laptop that I am trying to sync my iPhone (and iPad for that matter) via Wi-Fi but both devices are looking for the old laptop to sync.  My iTunes is version 11.0..3.42, iPhone is 6.1.4, and iPad 6.1.3.  Any suggestions?

    All I had to do was complain.  I synced my iPhone to the Windows machine, checked the other account at iTunes prompting (where no apps had shown up previously), reconnected the iPad, and 140 apps downloaded including the App Store.  I have no idea why.

  • In addition to my iMac, I have a Power Mac G4 (10.4.11 Tiger) which of course is pre-Intel.  I can boot up and use for about 5 minutes before the mouse freezes.  I believe something is   overheating.  What would that be - so I can have repairs done?  The

    In addition to my iMac, I have a Power Mac G4 (10.4.11 Tiger) which of course is pre-Intel.  I can boot up and use for about 5 minutes before the mouse freezes.  I believe something is
    overheating.  What would that be - so I can have repairs done?  The machine is the Digital Audio version, M7627LL/A and Serial Number XB******KXQ.
    <Edited By Host>

    Hello USME,
    'Tis a common problem on old Macs.
    Do as Allan says: open the door and blow out all the dust bunnies. Canned air from Wal-Mart or Radio Shack can be handy (though sort of expensive) especially for blowing through the back of the power supply. A cool Mac is a happy Mac.
    Be sure your Mac can breathe. The air intake is on the bottom of the case, so be sure a deep pile rug or too many papers on your desk are not blocking the air supply.
    Feel the power supply and the processor with your hand. They should be warm but not hot; if you have to move your hand away, that's too hot!
    Check the fan on the power supply, and on the processor if it has one. Take a flashlight and peer in the back of the (Mac) case through  the grille; make sure the fan is turning. If it's not, the power supply won't work for long.
    Fans are not considered serviceable, though they will succumb to mechanics of determination. A CPU fan is easy and straightforward.
    A fan replacement will not cure an already damaged power supply; the PS may already be done for. Used power supplies for a DA are hard to come by, and not especially cheap when found (c.$50). An entire  working DA or Quicksilver may often be found for under $100 on eBay, and swapping in your HD is easy and simple... this might be cheaper and more expeditious than repairing an expired DA. Replacing a power supply is fairly easy, but it's a nuisance and requires a 2mm Allen head wrench in addition to the usual #2 Phillips head screwdriver.
    In my experience, power supplies and CPUs are about equally likely to fail. There are a few other possibilities, but they are not nearly so common.
    Good luck!... Jon

  • TS3276 can anyone help on the following please. When I have been away from the office for a few days and check for emails it only supplies the most recent 100 emails and the ones before that are never received. thanks

    can anyone help on the following please. When I have been away from the office for a few days and check for emails it only supplies the most recent 100 emails and the ones before that are never received. thanks

    Does your server have a limit?

  • I have a subscription and I pay each month for that. I installed the suite Adobe (indesign, photoshop, illustrator and acroba) on my second computer (laptop) but they are installed like trial version. I can't activate them with my adobe. They still are tr

    I have a subscription and I pay each month for that. I installed the suite Adobe (indesign, photoshop, illustrator and acroba) on my second computer (laptop) but they are installed like trial version. I can't activate them with my adobe. They still are trial versions... How can I actvate them on my second computer ?

    On that computer... Does your Cloud subscription properly show on your account page?
    If you have more than one email, are you sure you are using the correct Adobe ID?
    https://www.adobe.com/account.html for subscriptions on your Adobe page
    If yes
    Some general information for a Cloud subscription
    Cloud programs do not use serial numbers... you log in to your paid Cloud account to download & install & activate... you MAY need to log out of the Cloud and restart your computer and log back in to the Cloud for things to work
    Log out of your Cloud account... Restart your computer... Log in to your paid Cloud account
    -Sign in help http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html
    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html
    -ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp
    -http://helpx.adobe.com/creative-cloud/kb/license-this-software.html
    If no
    This is an open forum, not Adobe support... you need Adobe staff to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"

  • Hi, Just bought an ipod classic 160gb and i notice that when I turn the volume down all the way, music is still heard, i.e. I cannot turn it down lower than a certain volume. Is there a fix for this? Thanks

    Hi, Just bought an ipod classic 160gb and i notice that when I turn the volume down all the way, music is still heard, i.e. I cannot turn it down lower than a certain volume. Is there a fix for this? Thanks

    I've got a feeling that's the way it is. I know that if I turn the volume down all the way, I can still hear the music very softly -- which is great for listening when I have a migraine!

  • I Cannot get my organizer to work for Elements 13. "A problem caused the program to stop working correctly. Windows will close the program......" is the error I get. I've uninstalled and reinstalled the program and tried various other things based on the

    I Cannot get my organizer to work for Elements 13. "A problem caused the program to stop working correctly. Windows will close the program......" is the error I get. I've uninstalled and reinstalled the program and tried various other things based on the MANY other complaints with this same issue and nothing is working. How can this problem be corrected?

    Hi,
    Which operating system are you running on?
    Are you upgrading from a previous version of Photoshop elements or is this your first?
    Are you trying to load the organizer or the editor or do both fail?
    Brian

  • I would like to do the 10 dollar a month download for photoshop but i already have purchased Lightroom,  can i get photoshop and muse for that price?

    I would like to do the 10 dollar a month download for photoshop but i already have purchased Lightroom,  can i get photoshop and muse for that price?

    Change Account https://forums.adobe.com/thread/1465499 may help

  • We are using apple tv to try to access our itunes account on the computer.  We see our library of music but when we click on the song it searches for a long time and then says that it cannot access the itunes store.  Any ideas on what we are doing wrong?

    We are using apple tv to try to access our itunes account on the computer.  We see our library of music but when we click on the song it searches for a long time and then says that it cannot access the itunes store.  Any ideas on what we are doing wrong?

    Welcome to the Apple Community.
    Try the following steps, check whether things are working after each step where appropriate, before trying the next.
    Restart the Apple TV (Settings > General > Restart).
    Restart the Apple TV by removing ALL the cables for 30 seconds.
    Restart your router.
    Reset the Apple TV (Settings > General > Reset > Reset all settings)
    Restore the Apple TV (Settings > General > Reset > Restore)

  • My mac book pro, deleted mi imovie, when a buy my macbook pro my imovie was in my apps, why i have tu buy and pay for that app now? i'm want my imovie back!

    My mac book pro, deleted mi imovie, when a buy my macbook pro my imovie was in my apps, why i have tu buy and pay for that app now? i'm want my imovie back!
    please!!! I HELP ME!

    I DONT UNDERSTAND why pay for imovie, because i;m pay for that when i buy the macbook pro..

  • Is there a way I can upgrade my Lightroom 3.6 to 4.1 and pay just for that? Or I must upgrade to 5 and pay for that. Thanks.

    Is there a way I can upgrade my Lightroom 3.6 to 4.1 and pay just for that? Or I must upgrade to 5 and pay for that. Thanks.

    Fishboynomad wrote:
    I thought upgrading to Lightroom 4.1 would be cheaper
    No, you can upgrade to the latest version of Lightroom from any version I think - certainly you can from LR3.

Maybe you are looking for