Doubt basic to GroupBy

I need to write a query that displays the name, salary and service employees who receive the maximum salary in their respective departments, assuming that there are two employees of different tables and Department.

Expected results:

Name Department salary
Allen 22000 operations
Barry HR 19000
Astrid Admin 9000

One way... Try this query.

  1  select e.deptno, e.ename, e.sal from emp e
  2  where (deptno, sal) in (
  3      select e1.deptno, max(e1.sal) from emp e1
  4     group by e1.deptno
  5  )
  6* order by e.deptno
sql> /

    DEPTNO ENAME             SAL
---------- ---------- ----------
        10 KING             5000
        20 FORD             3000
        20 SCOTT            3000
        30 BLAKE            2850

Query internal void gets question of departments and maximum salaries and the outer query shows employees with this number depertment and salary details.

The data used are the default emp tabe in the scott schema.

Tags: Database

Similar Questions

  • Doubts basic PL/SQL

    Hello Experts / gurus or friends;

    Hi all!

    I have fundamental doubts in PL? SQL. However I'll finish FUNTIONS.

    so I want to clarify some fundamental things. I google... but NOT clear

    > > MY QUESTIONS ARE > >

    During the creation of function or procedure.

    a few times I use 'IS' and so many times that I use 'AS' - Confused?

    > > I wrote the procedures following the methods > >



    create or replace procedure emp_details IS

    DECLARE the PROCEDURE HELLO AS

    Create procedure my_proc AS

    PROCEDURE HELLO AS

    BEGIN

    ....

    ....

    so my confusion, when I go with 'As' or 'IS'?

    -Is my question?

    I'll post my question once I clearly understand!

    Thanks in advance...

    Yes, you can think of each unit of PL/SQL created and compiled through CREATE (or REPLACE)... Statement to be stored in the database.

    "A stored subprogram is a subprogram that is stored in the database. Because they are stored in the database, the stored programs can be used as building blocks for many different database applications. (A subprogram that is declared in another subprogramme or in an anonymous block, is called a nested subroutine or local routine. It can be invoked from outside the subroutine or block in which it is declared. An anonymous block is a block that is not stored in the database.) »

    From: develop stored subprograms and packages

  • Doubts basic creation/modification of a Module

    Hello

    I'm a newbie at ATG, and I'm trying to understand how ATG (I work with ATG for just one week). I have some conclusions on ATG and I just want to confirm that I have just do.

    Configurations:
    Application server: WLS (Weblogic Server 11g)
    Version of the ATG: 10.0.3
    Database: Mysql
    Official database: Oracle
    IDE: Eclipse
    Develop the operating system: Windows 7 (yes I know linux isn't it better... but...)
    Official OS: Oracle Linux

    Conclusions and action I got:
    1. While ATG is a module
    2. do I need to create a new module to create a new store, or I have to work more crs?
    2.1. I have both, a new module and ReferenceStore under Eclipse IDE with all the taglibs and packages to work, I'm able to generate a constituent of any
    2.2. with this war, I'm able to run runAssembler.bat - pack xxx.ear m XXXECommerce Module and it generates a .ear
    2.3. with this .ear I'm capable of doing a deployment to WLS. (It runs without error to WLS but page index.jsp and all other open white and one occurs NullPointer interpretation tag dsp)

    Doubts:
    1 are. these conclusions correct?
    2. with my customizations in a .war do I do if erros happens running runAssembler and deployment?
    3 does anyone have a tutorial on how to create a new ecommercer site or how to use a crs as reference to build a store?

    Thank you!!

    Published by: onhate on December 20, 2011 10:06

    Published by: onhate on December 20, 2011 10:07

    You must run runAssembler as many times have you create ear files.

    In general, intermediaries, and Production will be same file ear with only a difference for data source files.
    These data source files, you can put in the localconfigs of specific server.

    The publication, you must create a new module and add the list of modules required in his MANIFESTO. MF file.

    Peace
    Shaik

  • Basic point doubt autoconfig...

    Hai all,

    As I am new to AppsDBA, I have a very basic question on the automatic configuration service. Please provide details...


    1. to run Autoconfig dbTier & AppsTier, two services of the level must be upward.

    2. whenever I start autoconfig on one level, is it mandatory to run on another level also?

    3. could you please give a good link to install a printer in Apps R12. (on windows2003)


    Thank you all

    Published by: userR12 on November 18, 2009 23:41

    Hello

    'cp' is not recognized as an internal or external command
    operable program or batch file.

    You have all the pre - req OS software installed on the target node (MS Visual C++, MKS,.. etc)?

    Please search for the executable file of cp and make sure that the directory where this file is located in the path before running the script adcfgclone.pl.

    Mr. Hussain, it would be more useful if you can start a new blog aspiring apps DBA. +

    No title please :) The blog is on my to-do list, but do not know when I will start with it.

    Kind regards
    Hussein

  • Installation of the Oracle Suite - Basic doubts

    Hi all

    Some fundamental doubts about the installation of the EBS.

    1. Why do we need to install a Unix - Cygwin or MKS Toolkit tools kit before installation of the EBS.

    2. Why do you have VC ++ 8.0 installed prior to installation of the EBS.

    3. which we need to install the loopback adapter in Windows2003. The steps presented in the thread link: Installation of Oracle E-Business Suite R12 on Windows 2003 does not call for installing loopback adapter,.
    Whereas it is shown as required in the case of Windows XP installation, wire link: Oracle E-Business Suite R12 steps for installing Windows XP

    Clarify pls.

    1. Why do we need to install a Unix - Cygwin or MKS Toolkit tools kit before installation of the EBS.

    2. Why do you have VC ++ 8.0 installed prior to installation of the EBS.

    For the reissue of the exactable application/database Oracle files links. These tools (cc, ld, ar... etc) are already installed under Linux/Unix, but not on Windows, that's why you need to install the software above.

    3. which we need to install the loopback adapter in Windows2003. The steps presented in the thread link: Installation of Oracle E-Business Suite R12 on Windows 2003 does not call for installing loopback adapter,.
    Whereas it is shown as required in the case of Windows XP installation, wire link: Oracle E-Business Suite R12 steps for installing Windows XP

    If your host is already connected to the network and an IP address, then card loopback is not necessary. Otherwise, you will need to set up the loopback adapter to have an IP address (for example, if you want to install Oracle apps on your computer/laptop at home that is not connected to a network).

  • Centro: a few questions which are basic, no doubt...

    I just got my Palm Centro and manage with two things... was hoping someone here could help me!

    1. is there a light (like a red light flashing on the phone) when I get a call or a text? Right now if I'm not far from my phone for a while and then the return, I turn again to see if I got a phone or text (I can't tell just by looking at the phone remotely, KELLER?).  If there is an option to get a type of light flashing, how do I turn it on?

    2. is there a way to organize my programs in categories?  I downloaded a few games of chess, etc.- and they are currently under the category "Uncategorized". I would like to move in 'Games', but I can't understand how do.

    Thank you!

    Hello PiPoFace

    (1) the only options for block of text alerts are to vibrate, volume (high or low) and message tone (custom tones). There is no default options to make a led Flash for missed SMS.

    To change the setting switch Application Pref - sounds & Alerts - select Messaging.

    _________________________________________________________

    You need to create 2 custom first categories): tap the top right where it says ALL (in the face of the time in the home screen). Once you type everything you will see a few options, select edit categories. In the categories Edit struck again and enter a custom category.

    All you have to do now is select the drop-down list located on the upper left side of the screen (home screen). In the drop-down menu, you will see the following: APP and Options. The APP you will see the category which will bring you to a screen filled with the application on the device, all you have to do is select your custom category that you created.

    I hope that's not too complicated.

  • Basic sql oca lession doubts 3 on error ora-01858

    SELECT last_name, hire_date
       FROM   employees
       WHERE  hire_date = TO_DATE('May 24, 1999', 'fxMonth DD, YYYY');
       
    talk about books, it will leave an error (ora-01858 which is a non-numeric error) but the statement being executed perfectly while
    by removing this "fx" - prefix gives an error called ora-01861.

    I'm confused here? can someone show me the right way?

    Hello

    The result depends on your NLS parameters. Yours probably are on something different than AMERICAN. In you language in may can then have a different number of characters (?)

    That's why you hit the ORA-01861 FX Format model with something else without. (Do not see why you should get ORA-01858, however)

    Concerning
    Peter

  • Toshiba Canvio Basics HARD drive does not appear in my computer

    Hello

    I have a HDTB110AK3BA - Toshiba 1 TB Canvio Plus Portable Hard Drive for storage 3.0 Basics and the computer will allow it to connect, but it does not appear in my computer / pc is in Device Manager thought but not my pc

    Please help and Windows 7 or windows 8.1 PC do the same thing.

    Hello

    I found the description of the product of this external HARD disk:

    Product features:
    • USB 3.0 - powered portable add-on storage.
    • Voltage of bus capable USB, no need for AC adapter.
    • Easy to use with no software to install.
    • Adapts to large digital files with spacious storage capacity.
    • Protect your drive (internal shock sensor and ramp loading technology).

    Specifications
    • Capacity: 1.0 TB
    • Interface: USB 3.0
    • Transfer rate: up to 5 Gb/s
    • Speed: 5 400 rpm
    • Average access time: 12ms
    • Cache buffer: 8 MB

    It is a HARD USB 3.0 drive. No doubt the HARD drive is not recognized correctly in windows exploerer due to the low power.
    The USB 2.0 port common feeds only 500mA. The USB 3.0 device must be able to 900mA.
    Therefore, it would be advisable to connect this 2 ports USB 2.0 HARD drive with a USB Y cable

  • Toshiba Stor.E Basics 2.5 ": how to get rid of the folder lang

    Hey there.

    So I have this external hard drive 500 GB Toshiba Stor.E Basics 2.5 " , bought a year in Italy.
    I use it on a MacBook with a few apps, so it works perfectly well.

    But the thing is there is this "lang" folderwith a subfolder of separate for each language (more a subfolder "resources"), which takes almost 28 GB of storage capacity, although it is completely empty. When I try to delete it, it doesn't let me, I get a message "file X is used" (where 'X' represents the subfolders).

    So I would like to know if there is a way to get rid of this file, as 28 GB are not exactly redundant.

    Thanks in advance! =)

    According to the disc specification page HARD (basic Stor.E); the quick start guide, as well as operating manuals was preinstalled.
    But I doubt that these documents should 28 GB of storage. So I think that some of your applications created the mentioned language folder, including subfolders.

    Usually, you must close the application that uses the files so you can easily remove the single folder. But in some cases, it may not be clear which program or a background process has locked a file or a folder.
    In this case, you can use a software free ware / tools to unlock the stubborn folder to change or remove.

    The software (for windows) called Unlocker is able to unlock the file, and then you could remove it properly.

  • buffer size and sync with the cDAQ 9188 problems and Visual Basic

    Hi all, I have a cDAQ-9188 with 9235 for quarter bridge straing caliber acquisition module.

    I would appreciate help to understand how synchronization and buffer.

    I do not use LabView: I'm developing in Visual Basic, Visual Studio 2010.

    I developed my app of the NI AcqStrainSample example. What I found in the order is:

    -CreateStrainGageChannel

    -ConfigureSampleClock

    -create an AnalogMultiChannelReader

    and

    -Start the task

    There is a timer in the VB application, once the task begun, that triggers the playback feature. This function uses:

    -AnalogMultiChannelReader.ReadWaveform (- 1).

    I have no problem with CreateStrainGageChannel, I put 8 channels and other settings.

    Regarding the ConfigureSampleClock, I have some doubts. I want a continuous acquisition, then I put the internal rate, signal source 1000, continuous sample mode, I set the size buffer using the parameter "sampled by channel.

    What I wonder is:

    (1) can I put any kind of buffer size? That the limited hardware of the module (9235) or DAQ (9188)?

    (2) can I read the buffer, let's say, once per second and read all samples stored in it?

    (3) do I have to implement my own buffer for playback of data acquisition, or it is not necessary?

    (4) because I don't want to lose packets: y at - it a timestamp index or a package, I can use to check for this?

    Thank you very much for the help

    Hi Roberto-

    I will address each of your questions:

    (1) can I put any kind of buffer size? That the limited hardware of the module (9235) or DAQ (9188)?

    The samplesPerChannel parameter has different features according to the synchronization mode, you choose.  If you choose finished samples the parameter samplesPerChannel determines how many sample clocks to generate and also determines the exact size to use.  But if you use streaming samples, the samplesPerChannel and speed settings are used together to determine the size of the buffer, according to this excerpt from the reference help C DAQmx:

    Note that this buffer is a buffer software host-side.  There can be no impact on the material available on the cDAQ-9188 or NI 9235 buffers.  These devices each have relatively small equipment pads and their firmware and the Driver NOR-DAQmx driver software transfer data device to automatically host and the most effective way possible.  The buffer on the host side then holds the data until you call DAQmx Read or otherwise the input stream of service.

    (2) can I read the buffer, let's say, once per second and read all samples stored in it?

    Yes.  You would achieve this by choosing a DAQmx Read size equal to the inverse of the sampling frequency (during 1 second data) or a multiple of that of the other playback times.

    (3) do I have to implement my own buffer for playback of data acquisition, or it is not necessary?

    No, you should not need to implement your own stamp.  The DAQmx buffer on the host side will contain the data until you call the DAQmx Read function.  If you want to read from this buffer less frequently you should consider increasing its size to avoid the overflow of this buffer.  Which brings me to your next question...

    (4) because I don't want to lose packets: y at - it a timestamp index or a package, I can use to check for this?

    DAQmx will meet you if all packets are lost.  The default behavior is to stop the flow of data and present an error if the buffer of the side host DAQmx overflows (if, for example, your application does not pick up samples of this buffer at a rate equal or faster than they are acquired, on average).

    If, for any reason, you want to let DAQmx to ignore the conditions of saturation (perhaps, for example, if you want to sample continuously at a high rate but want only interested in retrieving the most recent subset of samples), you can use the DAQmxSetReadOverWrite property and set it to DAQmx_Val_OverwriteUnreadSamps.

    I hope this helps.

  • Given upgrade Vista Home Basic to Home Premium 7

    Hello world! had a doubt: I plan to upgrade my Vista Home Basic to Home Premium 7, but I don't know if my computer will work as smooth as Vista. My system has achieved:

    • 2 GB OF RAM
    • NVidia GeForce 9500 GT (it will work very well. I think)
    • 250 GB HARD drive (well, it's like 230 GB)
    • Intel Core 2 Duo E6300 1.8 GHz per CPU
    • Everything except Office 2010 (Beta) and games very sophisticated (not Internet because I don't want to get viruses)

    My big problem is the games. I like to play great games like Assassin's Creed and Crysis, which move more great on Vista. I don't know if they will work as good as sound in Windows 7. Also, I would like to know the reqs. recommended for this system. Please answer!

    On Monday, April 12, 2010 00:14:49 + 0000, Manu97 wrote:

    > Hi everyone! had a doubt: I plan to upgrade my Vista Home Basic to Home Premium 7, but I don't know if my computer will work as smooth as Vista. My system got: 2 GB RAM NVidia GeForce 9500 GT (it will work very well. I think) 250 GB HARD drive (well, it's like 230 GB) Intel Core 2 Duo E6300 1 .8GHz by UC

    Your material sounds great for window s7.

    > Anything but Office 2010 (Beta) and sophisticated games (no Internet because I don't want to get viruses)
    >
    > My huge problem are the games. I like to play great games like Assassin's Creed and Crysis, which move more great on Vista. I don't know if they will work as good as sound in Windows 7. Also, I would like to know the reqs. recommended for this system. Please answer!

    Depends entirely on what games they are. It is likely that some will be
    work, but others can not.

    Check here:
    http://www.Microsoft.com/Windows/compatibility/Windows-7/en-us/default.aspx
    Ken Blake, Microsoft MVP (Windows desktop experience) since 2003
    Ken Blake, Microsoft MVP (Windows desktop experience) since 2003
    Ken Blake

  • Windows Installer does not not with vista basic error code #641

    WINDOWS INSTALL DOES NOT WORK ON VISTA BASIC.  I HAVE RCD CODE ERROR #641 PLEASE HELP

    Hi yorkieczar,

    Please take a look at the following information thanks to a post above by PA bear MS MVP:

    There is no doubt in my mind that System Mechanic caused this!

    And you have plenty of company, too. See these recent discussions-online

    ~~~~~~~~~~~~~~~~~~~~~~~~

    OPTION A: If you have backups of ALL System Mechanic has EVER done on your computer changes, restore ALL the & restart and test - and then uninstall System Mechanic & some other registry cleaners. [1]

    OPTION B: methods to execute the RESOLUTIONS 1, 2 and 3 in http://support.microsoft.com/kb/2642495 then reboot & test.

    OPTION C: Contact System Mechanic (iolo.com) support, assuming you have purchased System Mechanic Professional.

    ===========================================================
    [1] TIP: If you still think again your registry database must be cleaned, repaired, amplified, to the point, healed, twisted, fixed, enlarged, "swept" or optimized (it isn't), read http://aumha.net/viewtopic.php?t=28099 and draw your own conclusions. See also http://blogs.technet.com/markrussinovich/archive/2005/10/02/registry-junk-a-windows-fact-of-life.aspx

    Original thread:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-windows_update/Windows-updates-started-failing-on-5112012-get/86f0a57d-8fda-46C5-967F-8d95b34ba083?tab=MoreHelp

    I hope this helps!

  • Can I uninstall Advanced Audio FX Engine and Advanced Video FX Engine of Vista 32 Home Basic? Vista is a software equivalent installed in its place in the laptop?

    I have Vista Home Basic 32 bit Lap top. Advanced Audio multi-effects and Advanced Video FX Engine are seen installed in quite late after its purchase. Name of the Publisher is kept empty in the programs and features list. I doubt that this installation will somehow right now. I think the Vista 32 laptop could have its own built in software to do the functions of Advanced Audio FX Engine and Advanced Video FX Engine. For this reason, is it wise to uninstall and save the discspace?

    Hello

    ·         Is the manufacturer of the Dell laptop?

    Advanced audio and video FX engine are used to control the webcam and audio on Dell computers.  If you do not want control of the webcam, then it is safe to uninstall.

    See: http://windows.microsoft.com/en-US/windows-vista/Uninstall-or-change-a-program

  • I have a fatal error of the system on vista (Home Basic). Please help, it is said: __STOP: C000021a {fatal system error} initial session process or system _ ended unexpectedly with status 0x00000000 (0 xC0000001 0 X 00100450)

    That's what happened, I was using just disk defragment hard disk and since it takes a long time, I just left it alone and came to my laptop after a few minutes (about 15 minutes) and all of a sudden, I see my laptop is off.
    I turn it on again normally and after a while, the screen goes black and a blue screen with the message above appears. I press the "TURN OFF" button and it shuts down.
    That's the problem.

    I can not use safe mode or something, I tried everything in the F8 menu such as 'Last good known Configuration (Advanced)' and 'debugging '. Nothing works, all of this brings back me to the error message.

    The only thing I can do, is use the Startup Repair tool.

    It scans and tells me that he could correct errors, then I used the restoration of the system (to an earlier point), I haf 2 restore points but an error message appears and then they both became deleted. At the moment, I have no restore points.
    I can only use the command line Interface which directs me to "x: windows\system32\.

    I can use regedit (the registry editor). However, I tried another procedure step by step that earlier, I found that told me how to fix this problem, I typed in "System Root\System32\Drwtsn32.exe" and it says 'system is not recognized as an internal.... " »
    I also tried "System32\Drwtsn.exe" and he said: 'the path cannot be specified.
    I don't know what to do, I ask you is can you please help solve me this problem by using CMD and the registry editor. Please, thank you very much for your time.

    ADDITIONAL INFORMATION:
    My laptop...
    Windows Vista Home Basic
    1.00 GB of RAM
    AMD Athlon processor
    120 GB hard drive
    ATI Radeon X 1250 graphics card (that I could remember)

    It's strange, so you are always able to get into the safe mode command prompt is that correct? If so try to type sfc/scannow and see if it finds problems

    regarding the komodia, you can stop this cycle by quickly tapping F8 and select Disable automatic reboot after the system failuyre you should give the sfc/scannow suddenly too who could fix

    Oh and the reason for which you've entered in this thing drwtsn.exe and itt said it does not recognized is because you're not on the right track

    in any case I doubt that may help, but if you know you need to learn how to navigate your system using the command-line... pretty easy:

    CD means change directory

    If you type cd-it will take you to the root of the system

    so go ahead and type of

    Note that you are no longer in the c:\windows\system32 folder

    now type
    CD windows
    CD system32
    Drwtsn32

    Note that you can type the first few letters of a file or folder tab and press on to fill in the rest

    in any case, who should start the program that you try to start but I think that your better off trying to run the sfc/scannow command. Let me know how you go

  • Basic necessary for SSD + HDD Setup assistance

    Hello

    I know that this topic probably has to be put to death, but more I'm looking more confused I get.  I'm a total noob to the time modern PC s Please treat me like a fool in this regard :)

    I get a new rig built for me, especially for games. It includes Win 7 Home Premium 64-bit, an SSD 120 GB drive (which will be installed with OS startup disk) and a 1 TB WD Black HDD.  I intend to put some games on the SSD and everything else on the disk drive HARD (music, movies, documents, other games, etc etc).  Of course I have not yet, but basically I'm trying to anticipate the inevitable backups and partitioning issue when I get back to the computer.

    I understand that following the instructions on the installation of Win 7 with regard to the choice of the backup drives and create partitions etc should be simple enough.  What I am unclear of is as follows:

    To create a partition on my SSD and HARD drive?  If so the size should be partitions for each?

    * When creating partitions for backup, should there be that a single backup partition and this partition should be large enough to hold the combined SSD and HDD data or are they mainly just for backup OS and important documents?  I saw a tutorial here on how to include more than one disk in the backup process, so I think I can handle this quite well if necessary.  Of course, I'm hoping to have the backup partition on the HARD drive has a lot more space for him.

    * Is there an advantage in the creation of partitions/disks for specific things (one for the games, one for multimedia, documents, etc.) or is it OK to lump most of it in a player?

    One of my main concerns is the right balance with regard to the partition backup size/quantity: I don't want to put too much memory for what could possibly leave me short, nor do I want to find my backup partition/s are not large enough to hold whatever it takes.

    I will leave that for the moment, thanks in advance for your patience.  As I said, I checked these forums for the info I get but I just more confused and end with more questions than answers accordingly.

    Through the information provided in the links. This will permanently delete your doubts

    http://www.StorageReview.com/ssd_vs_hdd

    http://www.computerhope.com/jargon/s/SSD.htm

    http://SearchStorage.TechTarget.com/definition/hybrid-hard-drive

Maybe you are looking for

  • I connect to Shutterfly ok but get "You must be logged in, user ID required."

    I can connect to Shutterfly and everything seems normal. When I try to add pictures to share, I get, 'this command had an error during processing. The user id is required. I was connected because I had already entered my correct username and password

  • Keyboard ps2/usb adapter

    I have an old ps2 keyboard, I am trying to connect to my laptop (Pavilion g6) but cannot find how to do the bios to accept connections from the ps2. Windows (7) fails to recognize the hardware.There is no advanced option for bios where I could expect

  • No devices and Interface in MAX

    Hi all I recently installed the evaluation version of LabVIEW and I try to communicate with a dynamometer of Mark-10 series 5. The problem, however, is that MAX doesn't detect the device or any other instrument. It's not even a tree device and Interf

  • My home page is blocked by the get websiye download page template

    When I try to pull up my web [age on my laptop, a screen appears that says downloads.it view and the railway will open automatically and ask you then save and open.  This repeats and will let me spend.  I can't acess internet / someone has any sugges

  • Need help with error code "WindowsUpdate_00000646".

    can anyone help?