Help with one-liner & Get - VM vmnic

Hello

I need help with this single line. I want to get everything as vnmic for vmnic0 & line type. Everything underneath works but how to retrieve vmnic0 type also?

Get - vm | Select Name, Powerstate, NumCpu MemoryMB, @{N = "OSFullname"; E={$_. Guest.OsFullName}}

Thank you

If you do

Get - VM TEST01 | Get-NIC

has an entry called "NIC 1?

Tags: VMware

Similar Questions

  • Help with automated line breaks

    I import a file large tagged text created using XML and .xsl style sheets in CS4. The file is data directory of company that are transmitted as a paragraph in columns. We usually use Ventura to create this document and Ventura could process phone, fax, e-mail, and URL in one word and it breaks not between the lines. InDesign is to break these fields on new lines automatically as it strikes characters '-', ' @ 'and'. '.

    Is it possible in InDesign or my stylesheet .xsl to allow only line breaks on spaces and not others?

    For example, I get:

    ABC Company

    1234 main St, downtown, É.-u.

    01234, 555-555-5555, fax: 111.

    111-1111, info@abccompany.

    com, www.abccompany.com

    I want to:

    ABC Company

    1234 main St, downtown, USA

    01234, 555-555-5555, fax:

    111- 111-1111,

    info@abccompany. com,

    www.ABCCOMPANY.com

    I don't want to automatically add a line break before each element as the length would differ for each list and take too much space with forced line break.

    Thank you very much for your help!

    Ah. Try this GREP style, once again with No Break:

    [^ ]+

    This allows to keep whatever it is separated by spaces only together.

  • Help with the line chart

    I created a line chart in Illustrator CS3.  Everything is great, except that I need to change the colors of the lines.  There are two lines total.  I can't select just one line to change the color.  When I use the white arrow selection tool he will choose only a point-by-point and not the whole line.

    If I use the black arrow selection tool then selects all of the chart.

    Thanks a lot for any help on this!

    It's fine even if you have a selected point you can change the color of the line, make sure you change the color of the outline, not the color of the file.

    If you want to be treated and have all selected Bézier points (or select all lines in a group), hold the option key and click with the hollow tool to select all Bézier points. Option click again to select multiple levels within the group. The result will be the same whether in the postscript file produced Illustrator.

  • Help with the line on the image final after using the magnetic lasso + layers

    I worked on an image that has some distortion of the lens in the.  I need to change the background and the subject separately because the colors are similar and there is simply too much work to do to try and spot heal the whole thing.  I cut out the subject with the lasso, magnetic, and created 2 separate the layers, a topic, a single background.  I then used the layers: adjustment layer: hue / saturation to correct the distortion.  When I did, I flattened the image.  Now I have a gray line on my final image where the lasso tool had cut the image apart.  I have no idea why it's there or how to get rid of.  It is very thin and probably not noticeable on smaller images, but I am determined to blow this up BIG picture where every mistake will be visible.  Any suggestions on how to avoid this line in the first place?  I don't think that I can remove it without going by one pixel.  Thank you!

    A better way to make your adjustments is to simply use the same mask and avoid creating separate layers:

    Here's the original:

    1. Select the "subject."
    2. Add a Hue/Saturation layer, which will be automatically hidden from the subject.
    3. Adjust the H/S in function.
    4. Duplicate this layer H/S.
    5. Select the mask of the H/S duplicate layer and press Ctrl + I, which will reverse the colors of mask (which means that the area of "background" will be affected).
    6. Adjust this new H/W layer in function.
    7. Your layers will look like this:

    The final image:

    No no cutting, no copy, etc. - the mask and its reversal will give a perfect edge.

    Ken

  • Can all help with VI to get data (HEX) serial number and write in the text file

    Hello I am struggling with this problem for 2 months... They get help from different I thought I solved the problem, but of no use yet I stand on zero

    Problem: I need to get data on USB high speed HEXAGON shaped (coming in hexadecimal and be stored in the text file to the hexadecimal format as each hexadecimal value online different I'll also to attach the file)

    Get us ASCII on series or VISA read but when trying to convert to hex as shown in text file making it slower to deal with code, I know that my VI will have to improve more... I'm waiting for suggestions

    Need urgent help...

    Thanks in advance

    Hi Ali Afzal,.

    I think that the attached example can work for you. If not, then try the solution with sending the data to a parallel running the loop and store it there.

    Mike

  • Help with packaging line cmd...

    So I'm working on the use of the command line for the packaging of my application (for when my FlashBuilder trial runs out!) and I fell at the first hurdle. When I run blackberry-airpackager I get this error message.

    I feel that it's probably something incredibly obvious and I had a quick glance around forums but I do not see a solution, any help would be greatly appreciated. Thank you!

    Have the version of Java Runtime Environment 1.6 (AKA "JRE") is called in the system requirements:

    http://docs.BlackBerry.com/en/developers/deliverables/25068/System_requirements_1347126_11.jsp

    Try to type "java-version" at the command prompt to see if you have it installed.

    You should get a message will cost about java version and java execution environment has a number of 1.6 in it.

    Also type "echo JAVA_HOME %" on your command line to see if your environment variable for the system to find your java installation is set.

  • Please help with mesh lines!

    Hello

    I'm fighting with lines of mesh, I'm trying to make the cartoon bat wing, and a few lines of mesh is not all handles, but still do not follow a line, that I expect. I only learned the tool net for a day, but havn't find an answer to this at the moment :/

    This is where the question is;

    help.png

    and here's the global bat to give you an idea where I'm trying to get the shading;

    help2.png

    The bat was designed by my daughter 9 years as a line drawing, so I just try to bring it to life with shading! My first attempt at something like this if you laugh too much!

    Thank you

    Sally

    Try and use the anchor point to delete, and then move along the line until a point is indicated. Then click on. You can also try the mesh plugin hellion. It has a function to convert these points into editable points.

  • One-liner get running OS & OS & Cluster name configured

    Hi, need help here; We have 3 different DataCenters with names different groupings within each. However, due to the requirements of the DR, vm in double names exist in separate groups/data centers. When we run some scripts, I need to make sure that we work with the virtual machines in the correct cluster/Datacenter. I try this code, but do not get the name of the Cluster that the virtual machine is in. What Miss me?

    Notice-EEG - ViewType 'VirtualMachine' - property @("nom", "Config.GuestFullName", "Guest.GuestFullName") | Where-Object {($_.)} Config.GuestFullName - not $_. Guest.GuestFullName) - and ($_.) Guest.GuestFullName - no $null) - and ($_.) (Guest.PowerState-ne "Réceptrices")} | Select-Object - property name, @{N = "Configure OS"; E={$_. Config.GuestFullName}}, @{N = 'Running OS'; E={$_. Guest.GuestFullName}}, @{N = "Cluster name"; E={$_. {{Host.Parent.Name}} | Format-Table - Autosize

    Thanks for the help!

    You can find the NOMCLUSTER by following the Parent-trail

    Get-View -ViewType "VirtualMachine" -Property "Name","Config.GuestFullName","Guest.GuestFullName","Runtime.Host" |
    Where-Object {($_.Config.GuestFullName -ne $_.Guest.GuestFullName) -and ($_.Guest.GuestFullName -ne $null) -and ($_.Guest.PowerState -ne "PoweredOn")} |
    Select-Object -Property Name,
    @{N="Configured OS";E={$_.Config.GuestFullName}},
    @{N="Running OS";E={$_.Guest.GuestFullName}},
    @{N="Cluster Name";E={
        $parent = Get-View $_.Runtime.Host -Property Parent,Name
        while($parent -isnot [VMware.Vim.ClusterComputeResource]){
            $parent = Get-View $parent.Parent -Property Parent,Name
        }
        $Parent.Name
        }} |
    ft -AutoSize
    
  • Help with white lines around motif tiles in distorted envelope

    I am trying to create a label for a conical shape using a JPG image to a pattern repeated seamless: I create a pattern from a JPG file and apply it to a rectangle the size you want.  Everything looks great at this point, no white lines bordering each tile model.  Can I use envelope tool ' to a string.  Subsequently, white lines show around each tile on screen, as well as any print or export.  How can I stop the white lines appear in my work?Label Colorful w Hearts.jpg

    have you tried to rasterize after that you used to fill the shape of your property?

    If it is as you say, NOT to show the lines until you warp, you should be able to rasterize the entire block you filled with several "mosaics" of the model > then make the chain. I would have thought it was impossible cause there still wrong?

    If the final result is just to make this single 'work' then you always can tile it upward into photoshop and use the new image of 'model' in .ai and then make the chain?

    (essentially identical to rasterize in .ai, but you can at least work around any strangeness that is perhaps causing your current problem.)

  • Help with the cmdlet "get-floppydrive.

    Hey all

    Need help please? I'm trying to create a little script to check if a virtual machine has a floppy drive. I had a quick glance at the cmdlet GET-floppydrive and pretty much know how to check the configuration to a floppy disk "connected" (i.e. of connection state to connect to poweron e.t.c). I want to know is how an abouts to go check if a floppy drive is period

    I thought it might be something like that, but I think that its probably wrong.

    $vm = get - vm server1

    If ($vm.floppydrives - eq $True) {}

    Write to $vm.name

    }

    Any ideas?

    Munster

    You were near.

    $vm = get-vm server1
    
    if ($vm.floppydrives){
    Write $vm.name
    }
    

    You actually test it this way, what if $vm.floppydrivers is equal to $null or not.

    If there is no floppy drives that the property will be $null and the test will evaluate to $false.

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Need help with Javascript to get the value of standard report column

    Hi all

    Apex 3.1 version

    I have a query SQL (editable report) region where I need to do validations using a process of OnDemand and javascript. For this posting, I need to use the serial number and id of this same report line item. The function is called when the serial number is changed. I can get the serial number easily because it is a text field, however, the item id is a standard report column (which actually a text field or hidden gives me a checksum error, long story). How can I get the value of the standard report column to set the value of an element of the Application to use in my process of application as well as the serial number? Here is my code below.
    <script>
    
    function f_ValidateSerial(pThis)
    {
        
      // The row in the table
    
      var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
    
        //alert('Row is '+vRow);
    
    
      // Display the serial number
        //alert('The Serial Number is '+html_GetElement('f21_'+vRow).value);
    
      
     var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=ValidateSerial',0);
     get.add('F101_SERIAL_NUMBER',html_GetElement('f21_'+vRow).value);
     get.add('F101_INVENTORY_ITEM_ID',+html_GetElement(?????+vRow).value);   // Here's where I need to get the item id to set application item!!
     
     gReturn = get.get();
     
    if (gReturn)
        { 
          alert(gReturn);
        }
     
      if(gReturn)
        { 
          html_GetElement('f21_'+vRow).value = '';
        }
               
    }
    </script>

    Hello

    Ok

    Item ID is standard report column.
    If you enter this Expression HTML column

    #ITEM_ID#
    

    I guess that the substitution of column item Id is #ITEM_ID #.

    Now, you have hidden input form that is not submitted.
    Then in JavaScript

    get.add('F101_INVENTORY_ITEM_ID',+html_GetElement('item_id_'+Number(vRow)).value);
    

    Kind regards
    Jari

  • Need help with query to get days of work there are using the calendar BOM

    RDBMS: 10.2.0.4.0
    Oracle Applications: 11.5.10.2

    I try to use the BOM existing in the EBS to calculate working days calendar, there is a report that I am train. The BOM calendar presents the working days and non-working with the weekend days and holidays listed as non-working days. The following query gives correct results, but I'm looking for two different ways to do the same without "the union. I have nothing against the "unions", but I feel that I'm missing a more elegant to get there way. The query will in Discoverer Plus 10.1.2.3, so using a statement 'By' is not supported.
    sample data
    
    calendar_code                calendar_date                 seq_num                     
    SAC-WRKDAY                   12/3/2010                     1817
    SAC-WRKDAY                   12/4/2010                                                              
    SAC-WRKDAY                   12/5/2010                                                              
    SAC-WRKDAY                   12/6/2010                     1818                                 
    SAC-WRKDAY                   12/7/2010                     1819                                 
    SAC-WRKDAY                   12/8/2010                     1820     
    SAC-WRKDAY                   12/9/2010                     1821
    SAC-WRKDAY                   12/10/2010                    1822
    SAC-WRKDAY                   12/11/2010                   
    SAC-WRKDAY                   12/12/2010
    SAC-WRKDAY                   12/13/2010                    1823             
    select calendar_code
         , calendar_date
         , seq_num
         , sum(decode(bcd.seq_num,null,0,1))over(partition by bcd.calendar_code order by bcd.calendar_date desc) workdays_ago
    from   bom.bom_calendar_dates bcd
    where  calendar_code = 'SAC-WRKDAY'     
    and    trunc(bcd.calendar_date) < trunc(sysdate)
    
    union
    
    select calendar_code
         , calendar_date
         , seq_num
         , -sum(decode(bcd.seq_num,null,0,1))over(partition by bcd.calendar_code order by bcd.calendar_date ) workdays_ago
    from   bom.bom_calendar_dates bcd
    where  calendar_code = 'SAC-WRKDAY'
    and    trunc(bcd.calendar_date) > trunc(sysdate)
    sample output
    
    calendar_code                calendar_date                 seq_num                      workdays_ago
    SAC-WRKDAY                   12/3/2010                     1817                                  3
    SAC-WRKDAY                   12/4/2010                                                           2
    SAC-WRKDAY                   12/5/2010                                                           2
    SAC-WRKDAY                   12/6/2010                     1818                                  2
    SAC-WRKDAY                   12/7/2010                     1819                                  1
    SAC-WRKDAY                   12/9/2010                     1821                                 -1
    SAC-WRKDAY                   12/10/2010                    1822                                 -2
    SAC-WRKDAY                   12/11/2010                                                         -2
    SAC-WRKDAY                   12/12/2010                                                         -2
    SAC-WRKDAY                   12/13/2010                    1823                                 -3

    Hello

    Of course, you should be able to combine these queries, something like this:

    select calendar_code
         , calendar_date
         , seq_num
         , sum ( CASE
               WHEN  bcd.seq_num IS NULL
               THEN  0
               WHEN  bcd.calendar_date < TRUNC (SYSDATE)
               THEN  1
               ELSE  -1
              END
            ) over ( partition by  bcd.calendar_code
                  ,            SIGN (SYSDATE - bcd.calendar_date)
                  order by        ABS  (SYSDATE - bcd.calendar_date)
                ) workdays_ago
    from   bom.bom_calendar_dates bcd
    where  calendar_code = 'SAC-WRKDAY'
    and    trunc(bcd.calendar_date) < trunc(sysdate)
    

    If you do not want to display some CREATE TABLE and INSERT statements for the sample data, and then I could test it.

    t_norwillo wrote:
    ... I have nothing against the "unions", but I feel that I'm missing a more elegant to get there way.

    Good thinking!
    When the two branches of the UNION query the same table, there is usually a more effective way: something that only requires a pass through the table.

  • Help with random lines and its

    What I'm trying to make, is that the lines appear in various random places but they keep appearing in the same place without worrying.  Someone at - it a way to solve this problem?  As is - this does anyone have an idea on how to put a timer so after two minutes, all the lines disappear?  Thank you very much for the help.

    import flash.events.ActivityEvent;
    import flash.events.StatusEvent;
    import flash.media.Microphone;
    the line below code
    var container1:Sprite = new Sprite();
    var container2:Sprite = new Sprite();
    var container3:Sprite = new Sprite();
    var container4:Sprite = new Sprite();
    var container5:Sprite = new Sprite();
    random coordinates for container1
    var corcon1x:Number = Math.round (Math.random () * 600);
    var corcon1y:Number = Math.round (Math.random () * 600);
    var corcon2x:Number = Math.round (Math.random () * 600);
    var corcon2y:Number = Math.round (Math.random () * 600);
    random coordinates for container2
    var corcon3x:Number = Math.round (Math.random () * 600);
    var corcon3y:Number = Math.round (Math.random () * 600);
    var corcon4x:Number = Math.round (Math.random () * 600);
    var corcon4y:Number = Math.round (Math.random () * 600);
    random coordinates for 3
    var corcon5x:Number = Math.round (Math.random () * 600);
    var corcon5y:Number = Math.round (Math.random () * 600);
    var corcon6x:Number = Math.round (Math.random () * 600);
    var corcon6y:Number = Math.round (Math.random () * 600);
    random coordinates for container4
    var corcon7x:Number = Math.round (Math.random () * 600);
    var corcon7y:Number = Math.round (Math.random () * 600);
    var corcon8x:Number = Math.round (Math.random () * 600);
    var corcon8y:Number = Math.round (Math.random () * 600);
    random coordinates for container5
    var corcon9x:Number = Math.round (Math.random () * 600);
    var corcon9y:Number = Math.round (Math.random () * 600);
    var corcon10x:Number = Math.round (Math.random () * 600);
    var corcon10y:Number = Math.round (Math.random () * 600);
    micro code follows below
    var deviceArray:Array = Microphone.names;
    trace ("input devices, sound available :");
    for (var i: int = 0; i < deviceArray.length; i ++)
    {
    trace ("" + deviceArray [i]);
    }
    var mic:Microphone = Microphone.getMicrophone ();
    Security.showSettings (SecurityPanel.MICROPHONE); We added this line because he did not accept his otherwise
    MIC.gain = 60;
    MIC.rate = 11;
    mic.setUseEchoSuppression (true);
    mic.setLoopBack (true);
    mic.setSilenceLevel (5, 1000);

    mic.soundTransform = new SoundTransform (0, 0);
    mic.addEventListener (ActivityEvent.ACTIVITY, this.onMicActivity);
    mic.addEventListener (StatusEvent.STATUS, this.onMicStatus);

    var micDetails:String = "audio input device name:"+ mic.name + "\n"; '.
    micDetails += "Gain:"+ mic.gain + "\n"; '.
    micDetails += "rate:"+ mic.rate + "kHz" + "\n"; '.
    micDetails += ' Muted: "+ mic.muted +"\n"; '.
    micDetails += "Silence level:"+ mic.silenceLevel + "\n"; '.
    micDetails += "Silence timeout:"+ mic.silenceTimeout + "\n"; '.
    micDetails += "echo delete:"+ mic.useEchoSuppression + "\n"; '.
    trace (micDetails);

    function onMicActivity(event:ActivityEvent):void
    {
    }
    function onMicStatus(event:StatusEvent):void
    {
    }

    stage.addEventListener (Event.ENTER_FRAME, stage_EnterFrame);
    function stage_EnterFrame(e:Event)
    {

    If (mic.activityLevel < 20) {}
    test_text. Text = "20";
    addChild (container5);
    container5. Graphics.LineStyle(5,0x0000FF);
    container5. Graphics.MoveTo (corcon9x, corcon9y);
    container5. Graphics.LineTo (corcon10x, corcon10y);
    }
    ElseIf (mic.activityLevel > 20 & & mic.activityLevel < 40) {}
    test_text. Text = "40";
    addChild (container4);
    container4. Graphics.LineStyle(10,0x6600CC);
    container4. Graphics.MoveTo (corcon7x, corcon7y);
    container4. Graphics.LineTo (corcon8x, corcon8y);
    }
    ElseIf (mic.activityLevel > 40 & & mic.activityLevel < 60) {}
    test_text. Text = "60";
    addChild (container3);
    container3. Graphics.LineStyle (15, 0 x 009900);
    container3. Graphics.MoveTo (corcon5x, corcon5y);
    container3. Graphics.LineTo (corcon6x, corcon6y);
    }
    ElseIf (mic.activityLevel > 60 & & mic.activityLevel < 80) {}
    test_text. Text = "80";
    addChild (container2);
    container2. Graphics.LineStyle(20,0xffff00);
    container2. Graphics.MoveTo (corcon3x, corcon3y);
    container2. Graphics.LineTo (corcon4x, corcon4y);
    }
    ElseIf (mic.activityLevel > 80 & & mic.activityLevel < 100) {}
    test_text. Text = "100";
    addChild (container1);
    container1. Graphics.LineStyle(30,0xFF0000);
    container1. Graphics.MoveTo (corcon1x, corcon1y);
    container1. Graphics.LineTo (corcon2x, corcon2y);
    }
    trace (MIC.activityLevel);
    }

    import flash.events.ActivityEvent;
    import flash.events.StatusEvent;
    import flash.media.Microphone;
    the line below code

    var t:Timer = new Timer (60000,1);

    t.addEventListener (TimerEvent.TIMER, f);

    function f(e:Event):void {}

    stage.removeEventListener(Event.ENTER_FRAME, stage_EnterFrame);
    

    }

    var container1:Sprite = new Sprite();
    addChild (container1);
    micro code follows below
    var deviceArray:Array = Microphone.names;
    trace ("input devices, sound available :");
    for (var i: int = 0; i< devicearray.length;="">
    {
    trace ("" + deviceArray [i]);
    }
    var mic:Microphone = Microphone.getMicrophone ();
    Security.showSettings (SecurityPanel.MICROPHONE); We added this line because he did not accept his otherwise
    MIC.gain = 60;
    MIC.rate = 11;
    mic.setUseEchoSuppression (true);
    mic.setLoopBack (true);
    mic.setSilenceLevel (5, 1000);

    mic.soundTransform = new SoundTransform (0, 0);
    mic.addEventListener (ActivityEvent.ACTIVITY, this.onMicActivity);
    mic.addEventListener (StatusEvent.STATUS, this.onMicStatus);
        
    var micDetails:String = "audio input device name:"+ mic.name + "\n"; '.
    micDetails += "Gain:"+ mic.gain + "\n"; '.
    micDetails += "rate:"+ mic.rate + "kHz" + "\n"; '.
    micDetails += ' Muted: "+ mic.muted +"\n"; '.
    micDetails += "Silence level:"+ mic.silenceLevel + "\n"; '.
    micDetails += "Silence timeout:"+ mic.silenceTimeout + "\n"; '.
    micDetails += "echo delete:"+ mic.useEchoSuppression + "\n"; '.
    trace (micDetails);

    function onMicActivity(event:ActivityEvent):void
    {
    }
    function onMicStatus(event:StatusEvent):void
    {
    }

    stage.addEventListener (Event.ENTER_FRAME, stage_EnterFrame);
    function stage_EnterFrame(e:Event)
    {

    If (mic.activityLevel<>
    test_text. Text = "20";

    container1. Graphics.LineStyle(5,0x0000FF);

    }
    ElseIf (mic.activityLevel > 20 & mic.activityLevel)<>
    test_text. Text = "40";

    container1. Graphics.LineStyle(10,0x6600CC);

    }
    ElseIf (mic.activityLevel > 40 & mic.activityLevel)<>
    test_text. Text = "60";

    container1. Graphics.LineStyle (15, 0 x 009900);
    }
    ElseIf (mic.activityLevel > 60 & mic.activityLevel)<>
    test_text. Text = "80";

    container1. Graphics.LineStyle(20,0xffff00);
    }
    ElseIf (mic.activityLevel > 80 & mic.activityLevel)<>
    test_text. Text = "100";

    container1. Graphics.LineStyle(30,0xFF0000);
    }

         container1.graphics.moveTo(Math.round(Math.random()*600),Math.round(Math.random()*600));     container1.graphics.lineTo(Math.round(Math.random()*600),Math.round(Math.random()*600));
    

    trace (MIC.activityLevel);
    }

  • If anyone can help with how to get the image

    a database in a view using Dreamweaver page?

    I have a page with a recordset and a database with text and images. The image field has a link to the file and the image as in /images/image1.jpg including the size.

    The thumbnail I want to display on a page of the main display is in the database using varchar with a link like /images/image1.jpg

    When someone wants to see the master page, they click on a link and everything which has been entered showing the database. At least everything except the image.  Right now it shows just /images/image1.jpg

    I don't know how to call the images to the database.

    Thanks for the help and information.

    conch,

    Check the entry of the database, and you may also have too many tags...

    In addition, check to see if your pictures folder is in the root directory, such as an incorrect path can complicate things.

    If this site is located on a remote server, feel free to send me the link here or by e-mail: [email protected]

    In addition, if you have a screenshot, it would be useful.

    Hang on!

    See you soon,.

    wordman

  • Need help with Group functions

    I'm a total novice with SQL, so please forgive me if the answer to my question seems to be too obvious
    I work with diagrams of the sample (in particular with the employees table):

    DESC employees;
    result

    What I have to do is select all the managers, including the number of subordinates is higher than the average number of subordinates of managers who work in the same Department. What I've done so far is as follows:

    SELECT mgr.employee_id manager_id, Director of mgr.last_name, mgr.department_id, COUNT (emp.employee_id)
    Employees emp employees JOIN Bishop
    ON emp.manager_id = mgr.employee_id
    GROUP OF mgr.employee_id, mgr.last_name, mgr.department_id
    ORDER BY mgr.department_id;
    result

    As you can see, I'm almost done. Now, I need only to calculate the average of the result of the COUNT function for each Department. But I'm totally stuck at this point.
    All advice?

    Hello

    Welcome to the forum!

    user12107811 wrote:
    I'm a total novice with SQL, so please forgive me if the answer to my question seems to be too obvious

    Just the opposite! Looks like a very difficult mission.

    I work with diagrams of the sample (in particular with the employees table):

    DESC employees;
    result

    What I have to do is select all the managers, including the number of subordinates is higher than the average number of subordinates of managers who work in the same Department. What I've done so far is as follows:

    SELECT mgr.employee_id manager_id, Director of mgr.last_name, mgr.department_id, COUNT (emp.employee_id)
    Employees emp employees JOIN Bishop
    ON emp.manager_id = mgr.employee_id
    GROUP OF mgr.employee_id, mgr.last_name, mgr.department_id
    ORDER BY mgr.department_id;
    result

    As you can see, I'm almost done. Now, I need only to calculate the average of the result of the COUNT function for each Department. But I'm totally stuck at this point.
    All advice?

    Yes, you're almost done. You just need to add one more condition. You have to calculate the average value of total_cnt (the COUNT (*) you already do) of a Department and compare that to total_cnt.

    There are several ways to do this, including
    a scalar subquery (in a HAVING clause)
    (b) make a result set with one line per Department, containing the average_cnt and reach than your current result set
    (c) analytical functions. Analytical functions are calculated after the GROUP BY clause is applied and aggregate functions are calculated, it is legitimate to say "AVG (COUNT (*)) MORE (...)").

    If thinking (c) is the simplest. It involves the use of a query of Tahina, but (a) and (b) also require subqueries.

    This sounds like homework, so I'll do it for you.
    Instead, here is a very similar problem with the hr.employees table.
    Let's say that we are interested in total wages given each type of work in each Department.

    SELECT        department_id
    ,        job_id
    ,        SUM (salary)     AS sum_sal
    FROM        hr.employees
    GROUP BY   department_id
    ,             job_id
    ORDER BY   department_id
    ,             job_id
    ;
    

    Results:

    DEPARTMENT_ID JOB_ID        SUM_SAL
    ------------- ---------- ----------
               10 AD_ASST          4400
               20 MK_MAN          13000
               20 MK_REP           6000
               30 PU_CLERK        13900
               30 PU_MAN          11000
               40 HR_REP           6500
               50 SH_CLERK        64300
               50 ST_CLERK        55700
               50 ST_MAN          36400
               60 IT_PROG         28800
               70 PR_REP          10000
               80 SA_MAN          61000
               80 SA_REP         243500
               90 AD_PRES         24000
               90 AD_VP           34000
              100 FI_ACCOUNT      39600
              100 FI_MGR          12000
              110 AC_ACCOUNT       8300
              110 AC_MGR          12000
                  SA_REP           7000
    

    Now suppose we want to find out which of these sum_sals is higher than the average sum_sal of his Department.
    For example, in detriment 110 (near the end OIF the list) there two types of work (AC_ACCOUND and AC_MGR) that have sum_sals of 8300 and 12000. The average of these two numbers is 10150, so we selected AC_MGR (because its sum_sal, 12000, is superior to 10150, and we do not want to include AC_ACCOUNT, because its sum_sal, 8300, is less than or equal to the average of the Department.
    In departments where there is only one job type (for example, Department 70, or null "Department" at the end of the list above) the only sum_sal will be the average; and because the sum_sal is not greater than the average, we want to exclude this line.

    Let's start with the calculation of the avg_sum_sal using the analytical function AVG:

    SELECT        department_id
    ,        job_id
    ,        SUM (salary)                              AS sum_sal
    ,        AVG (SUM (salary)) OVER (PARTITION BY department_id)     AS avg_sum_sal
    FROM        hr.employees
    GROUP BY   department_id
    ,             job_id
    ORDER BY   department_id
    ,             job_id
    ;
    

    Output:

    DEPARTMENT_ID JOB_ID        SUM_SAL AVG_SUM_SAL
    ------------- ---------- ---------- -----------
               10 AD_ASST          4400        4400
               20 MK_MAN          13000        9500
               20 MK_REP           6000        9500
               30 PU_CLERK        13900       12450
               30 PU_MAN          11000       12450
               40 HR_REP           6500        6500
               50 SH_CLERK        64300  52133.3333
               50 ST_CLERK        55700  52133.3333
               50 ST_MAN          36400  52133.3333
               60 IT_PROG         28800       28800
               70 PR_REP          10000       10000
               80 SA_MAN          61000      152250
               80 SA_REP         243500      152250
               90 AD_PRES         24000       29000
               90 AD_VP           34000       29000
              100 FI_ACCOUNT      39600       25800
              100 FI_MGR          12000       25800
              110 AC_ACCOUNT       8300       10150
              110 AC_MGR          12000       10150
                  SA_REP           7000        7000
    

    Now all we have to do is to compare the sum_sal and avg_sum_sal columns.
    Given that the analytic functions are calculated after the WHERE clause is applied, we cannot use avg_sum_sal in the WHERE clause of the query, even where it has been calculated. But we can do that in a subquery; Then, we can use avg_sum_sal in any way that we love in the Super-requete:

    WITH     got_avg_sum_sal       AS
    (
         SELECT        department_id
         ,        job_id
         ,        SUM (salary)                              AS sum_sal
         ,        AVG (SUM (salary)) OVER (PARTITION BY department_id)     AS avg_sum_sal
         FROM        hr.employees
         GROUP BY   department_id
         ,             job_id
    )
    SELECT        department_id
    ,        job_id
    ,        sum_sal
    FROM        got_avg_sum_sal
    WHERE        sum_sal     > avg_sum_sal
    ORDER BY   department_id
    ,             job_id
    ;
    

    Results:

    DEPARTMENT_ID JOB_ID        SUM_SAL
    ------------- ---------- ----------
               20 MK_MAN          13000
               30 PU_CLERK        13900
               50 SH_CLERK        64300
               50 ST_CLERK        55700
               80 SA_REP         243500
               90 AD_VP           34000
              100 FI_ACCOUNT      39600
              110 AC_MGR          12000
    

Maybe you are looking for

  • Sam 5100 Bluetooth stack do not work

    No matter what the parameter is set to the test, the answer is "Bluetooth is not ready."-definition of COM ports-opening new connectionDebice is turned on both physically (switch) and in the bluetooth Manager.Hardware problem?

  • Need drivers XP for Satellite A200-1CR

    Hi all can someone please help me to find a driver for all devices for the XP? my laptop is: A200-1CR I found everything that for vista and I would like to use a XP. so, please help me urgently please Thanks a lot to all

  • Please help - spell decoder problem

    Hello I have problems with an assignment for a segment of decoder display 7 in hexadecimal. Everthing works except when I get 0010 binary which should display the number 2 on the 7 segment display I get a light on the segment f. I checked all my door

  • How to allow customers using my laptop to access the internet?

    as an administrator of this computer how to let guests have access to the internet by using the dial-up usb modem or wireless?

  • Where are the error messages

    Hello I hope I get some answers. I'm not a big fan of BB from my personal experience with the Playbook and customer service.  As my organization uses BB, I am here asking questions. I am running and modify samples WebWorks. I'm on BB 10 device instal