Using the SQL commands

Hi I need help with my sql commands please.
1. build a query to list the name of the Department with pay the lowest.
2.construct a query to list the personnel number of the Manager (without duplicates) for managers who make more than twice the average salary of their employees
(Note that not all managers have a function of MANAGER).

I just need some advice please

Published by: 888669 on October 28, 2011 10:36

888669 wrote:
I had the min() function before and I got a message error "function group is nested too deeply.

Select dname, sum (sal) of the Department of inner join emp = dept.deptno emp.deptno group of dname with min (sum (sal));

Try:

select ...
from ....
group by deptno
having sum(sal) <= ALL (SELECT sum(sal) from emp group by deptno)

Tags: Database

Similar Questions

  • creation of database using the SQL command * more

    Hello

    This isn't a matter of urgency.

    I learn the Oracle DBA. I have installed Oracle 9.2 in my windows system. And I'm trying to create a database using the SQL command.

    OracleVersion: 9.2
    Windows XP operating system

    CREATE DATABASE suri
    USER SYS identified by manager
    USER system identified by surendra
    LOGFILE GROUP 1 ('F:\Oracle\oradata\suri\redo01.log') SIZE 100M,
            GROUP 2 ('F:\Oracle\oradata\suri\redo02.log') SIZE 100M,
            GROUP 3 ('F:\Oracle\oradata\suri\redo03.log') SIZE 100M
       MAXLOGFILES 5
       MAXLOGMEMBERS 5
       MAXLOGHISTORY 1
       MAXDATAFILES 100
       MAXINSTANCES 1
       CHARACTER SET US7ASCII
       NATIONAL CHARACTER SET AL16UTF16
    DATAFILE 'F:\Oracle\oradata\suri\system01.dbf' size 200M EXTENT MANAGEMENT LOCAL
    UNDO tablespace undots datafile 'F:\Oracle\oradata\suri\undots01.dbf' size 200M
    DEFAULT TEMPORARY TABLESPACE tempts1 DATAFILE 'F:\Oracle\oradata\suri\temp01.dbf' SIZE 100M EXTENT MANAGEMENT LOCAL
    I get the error like below when executing the CREATE DATABASE command.

    ERROR at line 16:
    ORA-25139: invalid option for CREATE TEMPORARY TABLESPACE
    I have validated the syntax but not able to find where is the error.

    Please let me know if you need more details.

    Thanks in advance for your help.


    Kind regards
    Suri

    OracleVersion: 9.2

    Why a so old version (and desupported)? In any case...

    TEMPORARY TABLESPACE tempts1 DATAFILE 'F:\Oracle\oradata\suri\temp01.dbf' SIZE 100 M EXTENT MANAGEMENT LOCAL default

    .. try change DATAFILE with TEMPFILE.

  • Maximum length of the SQL command

    I created a MySQL database and a LabView 8.6 application that inserts data into the database using the SQL Toolbox.  I have a problem very long character data insertion in a LONGTEXT field.  I determined that the problem occurs when the SQL command is more than 1 048 574 characters or the length of a particular field exceeds 1 048 326 characters (cannot say who).

    The error I get is "error-2147467259 occurred at NI_Database_API.lvlib:Conn Execute.vi.  "Exception occurred in the Microsoft OLE DB provider for ODBC drivers: [MySQL] [ODBC 5.1 Driver] [mysqld - 5.1.35 - community] MySQL version disappeared in NI_Database_API.lvlib:Conn Execute.vi.

    According to the MYSQL documentation, a LONGTEXT can 4294967295 characters, so length shouldn't be a problem.  The documentation also indicates "the effective maximum length of LONGTEXT columns also depends on the maximum packet size that is configured in the client/server protocol and available memory", but I don't know how to configure the packet size in LabView.

    I enclose the code example that reproduces the problem, although it is based on a special run table structure effectively.  The table definition is included on the diagram.

    This setting must be configured outside of LabVIEW (UDL or DSN).

    You must configure the server and the client:

    I found this link while searching on stackoverflow

    http://dev.MySQL.com/doc/refman/5.1/en/packet-too-large.html

    You may need to select/Configure a specific vendor (different) in order to set this variable.

  • Access to SQL previously saved in the SQL command window

    Hi all

    If I kept some codes SQL in the SQL command window, should we not available to other developers when they click on the saved SQL tab? I saved an example query and one of my other developers can't see it. I don't see any setting available on the developer account that controls whether or not the account can see others saved SQL.

    If this is not allowed, then I see really the point of the drop in the saved SQL owner tab.

    Any advice?

    Thank you!!
    John

    My apologies - I've never used this tab so I was not aware of it.

    I played a little and it seems that if you are an administrator of the workspace, but your other user is just a developer, then in fact he or she cannot see your SQL. If you were to switch to the workspace administrators, they should be able to see.

  • How to write the sql command in the batch file

    Jin
    I m using oracle 9i on windows. I want to know how I can write the sql on the command file command. I want to use a batch file to use the sql like shutdowm command & start command and any select command too.
    so please tell how can I do?


    thxs

    Tried looking for what he superdba.

    Can't connect to sqlplus using sys using a batch file

    HTH
    Aman...

  • I get a message: to use the 'java' command line tool, you must install a JDK.  I tried 10 times to install without success.  Help, please.

    I get a message: to use the 'java' command line tool, you must install a JDK.  I tried 10 times to install without success.  Help, please.

    You probably have some of the older than the needs/desires software legacy Java installed.

    Please see these sons of community message:

    After the installation of El Capitan, I get the message: to use the 'java' command line tool, you must install a JDK

    Just found this last Java does not work with El Capitan

    This is the Apple link to the legacy version of Java 6.

    Download Java for OS X 2015-001

    First of all, I would like to try to identify what application generated the next message and update (delete) this request as the case may be. If you need to run Java then, as the Apple Support page says it's certainly preferable that your installation of Java entirely up-to-date with the Oracle's Java course. If you can get without Java, you should install it not - like the Flash, it should not be installed unless you have no choice.

  • Control mouse using the voice command

    Hey...

    I'm doing project control of mouse by simple voice command and also the click of mouse using the voice command action...

    I have problem to compare my order with the standard command...

    Please help how I can make this comparison and produce output...

    Ginelle

    I would like to start by this library. I found this a long time ago, but it would allow you to build what you need

  • Use the same command

    Hello

    My VI look like her:

    I would like to re - use the same command in my "everything".

    I have several cases and I don't want to create several command text.

    If someone kown one travel, please tell me how.

    Next

    Hello

    I may not be correctly undestand your question, but you can use a local variable for what you're trying to make...

  • Cannot use the 'MDGS' command in Windows 7

    original title: need help with a Comand prompt

    Hi, I need help with a problem in the command prompt. Whenever I try to use the "msg" command, it displays an error indicating it is unavailable this command has been changed?

    MSG is not a command that is available in Windows 7.  You can get a list of available commands by typing help at the command line, or

    help > C:\Users\YourUserName\Desktop\Windows7DOSCommands.txt

    to put the list in a text file on your desktop

  • Trojan: Win32 / Sysdef - fake. How do I restore office files, etc. by using the attrib command? Thank you

    I worked with the Microsoft Support to discover some hidden files. The tech told me that the files are still there, just hidden. He used the attrib command to discover some of the files. The tech said the remaining files must be made manually, how?

    How to find the files? My office is still hidden. I have bookmarks and word files.

    Thank you

    See Steve Cochran's response, dated June 2, 2011 in this thread: http://answers.microsoft.com/en-us/windows/forum/windows_vista-security/how-do-i-recover-windows-files-from-the-start-menu/96d70458-4fb4-403f-ac96-e88f5b6ffec4

    See the instructions for removing the difficulty system in the following link: http://www.bleepingcomputer.com/virus-removal/remove-system-fix which includes a presentation about the hidden files and folders.

    Are you sure that you have more malware on the computer?  Have you run everything on scanners such as Malwarebytes or Superantispyware?

  • Create a new folder or change the name of a folder on the desktop does not display until I use the refresh command

    After changing the name of a folder or a file on the desktop or by creating a new folder (and then hit enter), the folder or the text file doesn't change - until I use the Refresh command. Then, the text shows correctly and the movements of folder or a file in a place open to the top left of the screen. Before using "Refresh" the folder or the file will not open. When I save a file on the desktop is not visible until the 'Refresh' is used. Sometimes, but not always the same behavior occurs in other folders as well.  I use Win XP SP3. Can someone please shed some light on this?

    Hello

    ·        Since when are you facing this problem?

    ·        Remember to make changes to the system?

    ·

    Method 1:

    I suggest you check in safe mode. Follow the steps mentioned below.

    a. restart the computer and keep tapping F8 until you reach the start menu.

    b. click on safe mode from the list and press ENTER.

    Check if the problem persists.

    Method 2:

    I suggest you to scan your system for viruses and malware using a care Microsoft and Microsoft security essentials. Check the links below.

    http://OneCare.live.com/site/en-us/default.htm

    http://www.Microsoft.com/security_essentials/

    Method 3:

    Create a new user account and check if the problem persists.

    How to create and configure user accounts in Windows XP

    http://support.Microsoft.com/kb/279783

    Thanks and regards.

    Thahaseena M
    Microsoft Answers Support Engineer.
    Visit ourMicrosoft answers feedback Forum and let us know what you think.

  • When I get an email, according to windowsmail with attachments, I can't file attachments by using the file command menu

    original title: impossible to file attachments in mail

    Hello; I'm with family Vista premium and windows mail as a messaging system. I was with IE8, and now I've migrated to IE9.

    When I get an email, under windowsmail with attachments, I can't file attachments by using the file command menu. This option is blocked. Under windows mail, I went to tools, options, security and made sure that: Let not the attachments which are unsecured... box be deselected. It makes no difference, and I still can't save attachment like this; I CAN SAVE BY CLICKING and opening the attachment and save it but it is not satisfactory that I can't save the attachment by using the file command menu.

    Can you help me please?

    IE9 is certainly the culprit and there is more questions. I know that some MVPs have contacted their MS threads about it and even received no answer.

    My guess is that MS will not address this issue. Do not forget that the development team of Windows Mail is dissolved by the MS in June 2006. (Yes, while Vista was still in beta). I seriously doubt they care.

  • How to use the MSG command

    Hi all

    I want to use the MSG command send message from my computer to other computers on a network. We work in windows 7 and I used the following syntax:

    MSG * / server IP: address 'Message '.

    but the message back to my computer even if I use the IP address of another computer

    Thank you

    Hi Michael,

    Advanced networking issues are supported in the TechNet Forums. I suggest you send the request in the TechNet forums.
    http://social.technet.Microsoft.com/forums/Windows/en-us/home?Forum=w7itpronetworking

    Hope this information helps.

  • How can I prevent the access denied message when you use the shutdown command?

    I use shutdown /m \\computername/s

    I have "Access denied (5)" as an answer.
    I am admin on all my computers. Same username and password on each of them.
    How can I get this shutdown command to work remotely, so I can't access every computer command prompt via Remote Desktop?
    How can I prevent the access denied message when you use the shutdown command?

    Hello

    I suggest you to report this issue in TechNet Forums for Windows 7 networks: http://social.technet.microsoft.com/Forums/en-US/w7itpronetworking/threads

    Thank you.

  • graphic execution using the unix command

    I'm new to endeca3.1

    is there an available way to run the chart using the unix command?

    How can I plan the graph in the cron tab?

    Take a look at the Guide to the Integrator ETL server (Server CloverETL), Chapter 6, Scheduling and also chapter 14 on the Simple HTTP API.  This should allow you to plan or call graphical ETL published to the server.

    http://docs.Oracle.com/CD/E40518_01/Integrator.311/IntegratorServerGuide.PDF

Maybe you are looking for

  • Update my Photo from 2015 to 2016 calendar

    I created calendars of gift for recent years with pictures for each month. But then I have to insert birthdays and personal events day date. Is it possible to import the created calendar year last in the new schedule for 2016?

  • Reinstalling XP Pro

    I have a laptop that has XP Pro with SP3, unused for 2 years. From, it did nothing, so I started to reinstall Dell drive, also 2 years old. Windows Setup starts normally, but stops after a minute error 0x000000c5. I could find no way out of this at a

  • Force10 S60 - activation Web GUI

    Does anyone know how to activate/access web GUI on a Force10 S60?  I have the switch set to the point that I can ping from a client, but I can't seem to get access from a web browser.  The help files have not gave me so much about the issue, so I hop

  • Cover blackBerry Blackberry Curve Smartphones 9320

    Help, I have two left hands, try inserting a micro sd, first time card and can not figure out how to get down the back cover of my phone.  Is it supposed to slide or y at - there somewhere a release.

  • HumanTask UserInterface project update

    I have a human task generated a given simple object consists of two nodes. It works very well. Now, I've added a new node in the data object and I want this change of human mission. How can I do?I use Jdev 11.1.1.7 and bpm 11gUsman-