I need avg for each lines dept of sage, matched and unmatched wage table

Hi gurus,
I doubt in sql, the employee table and department table two tables are there.

1. I need pay for avg to each dept wise.

2. matched and unmatched in the rows of the table

in a request format

Thanks and greetings
k.Raghavan

945795 wrote:
Hi gurus,
I doubt in sql, the employee table and department table two tables are there.

Personally, it looks more like a HOME and WORK, only a DOUBT! What are your efforts on your bottom of DOUBTS?

1. I need pay for avg to each dept wise.

select department_id, avg(salary)
  from hr.employees
 group by department_id;

2. matched and unmatched in the rows of the table

The number of matching rows:

select employee_id, department_name
  from hr.employees natural join hr.departments;

Unpaired lines:

select department_id, department_name
  from hr.departments d
 where not exists (
                select 'x'
                  from hr.employees e
                 where d.department_id = e.department_id
              )

Tags: Database

Similar Questions

  • connect by query, element need root for each line

    Hello

    I'm working on a hierarchical query using connection by front. Each node in the tree has two properties, a type and a sequence.

    The table that contains the hierarchy has 4 fields:
    element_type_from
    element_sequence_from
    element_type_to
    element_sequence_to

    Each child has a parent, a parent can have several childeren. For a map, the element_type_to and element_sequence_to fields are zero.

    To generate a tree, you can run:
    select element_type_to
    ,      element_sequence_to
    from   element_hierarchy
    start with element_type_from = [root_element_type]
           and element_sequence_from = [root_element_sequence]
    connect by prior element_type_to = element_type_from
           and prior element_sequence_to = element_sequence_from
    That works well... but... not only don't want child elements, I would like to return the sequence of element root for each child (in our table is a type of root element is always the same). There are several root elements and I want to create a list containing all the trees and each node in the tree must have its roots as well.

    There is the possibility to use sys_connect_by_path. This returns the root, but also the full path to the current child. It also returns a varchar2, requiring to be substr-ed and to_number-ed to get the sequence... not nice.

    warning, extremely ugly (but functional) code:
    select element_type_to
    ,      element_sequence_to
    ,      to_number(substr(sys_connect_by_path(element_sequence_from ,','),2,instr(sys_connect_by_path(element_sequence_from ,',') ||',',',',2)-2)) root_sequence
    from   element_hierarchy
    start with element_type_from = [root_element_type]
           and element_sequence_from = ( select [root_element_sequence] from all_root_elements )
    connect by prior element_type_to = element_type_from
           and prior element_sequence_to = element_sequence_from
    There must be something simple I'm missing here! Can you help me?

    Edit: Oops, the database version is 10.2.0.4.0

    CONNECT_BY_ROOT maybe?

  • LabVIEW allows to read an Excel file to a control and add a checkbox for each line

    As say the topic, I need to use labview to read an excel file and show it in a control, such as mclb; I should add a checkbox for each line then allow me to choose the line I want. What should I do? Thank you very much.

    guiming wrote:

    I can read an Excel file to a spreadsheet, but I have no idea how to do to add a checkbox for each line.

    Sometimes, all you need to do is Google. https://decibel.NI.com/content/docs/doc-25000

    http://www.labviewing.com/check-box-in-multicolumn-ListBox/

  • How do I either set channel name of a graph of cluster or get a 1 d waveform chart to start different time (t0) for each line of the waveform?

    I have a chart single 2D out a conditional of a loop indexing output such that over the rows of the table are not the same size. -Basically, they have different starting and ending points and sizes. -Not so concerned by the endpoints, because as soon as I get correctly starting points, everything shows fall in place.

    The challenge is that when I try to have the variable t0 (start time) for each line, the wave of construction vi form would always keep each line at the same starting point.

    I used the approach bundled with success (the cluster approach ensures that each waveform starts at different times according to the guidelines of my t0 defined for each line) but then I'm not able to get in the channel names I could make using the graphical approach (wave generation) waveform.

    In essence what I get here, I'm losing here.

    Because I don't want one of my mentors, Bob and Altenbach have fed up with me I have attached a vi this time

    Attached VI shows a combination of the two attempts (first with the waveform graph) and then with the graph of cluster

    1. with the first (graphical waveform), I get my channel names as you wish, but the alignment of the wave is not correct.

    2. with the second (graphical cluster), the alignment is good, but I can't do the names of channel in the chart, even if they are present in the cluster.

    I read some reviews that mentions that attributes can be displayed with waveform and data Dynamics (not clsuters) so I guess that's why.

    I saw another report indicating the start time for a waveform 1 d will always remain the same for the rest lines defined for the first line even if changed for the following lines in a loop.

    So I guess my question is: what is the way around questions like that?

    First of all, let me be the first to the congratulate and thank you for finally posting a code!  I'm not 100% certain I understand your question or your code, but I have an idea, perhaps, of what you want to do, so I wrote a little VI who made something simple that could be relevant.

    You mention waveforms of different lengths and beginning at different times.  You also want everyone to have a unique attribute (although I'm not sure what you want to do with the attribute).  So, I did the following:

    1. Generated an array of 100-sample random to represent one second of a waveform.
    2. Created 4 waveforms on this 100-sample basis.  The first waveform (channel 0) is just these 100 points.  The second, 1 channel, is the concatenation of string 0 with the base of 100 samples, or a waveform "double".  Channel 2 is 1 string concatenated with the base, and channel 3 is 2 string concatenated with the base.
    3. In order to trace the four channels that they rest 'on' the other, the waveform has the number of the channel added to it.  Channel 3 is 3 + (4 copies of the basis of 100 points), a waveform 400-point random centered around a shift of 3.
    4. All channels have dt value 0.01 (but I guess I could have varied, as well).
    5. To make the channels start at different times, I started channel N N seconds before channel 0 (by subtracting the index of the loop, I, T0).
    6. For each channel, I created an attribute called "Chan" equal to "Channel N" (where N = 0, 1, 2 or 3, as the case may be).

    This is the plot that results. Scale X is the absolute time value (no Date) using the 24-hour HH: mmS format.  You can see that the plots are 1, 2, 3 and 4 seconds of time, and are offset from each other by a second.  I used the trace attributes to change the name to the respective attribute.

    The code to do this is very simple - I almost don't need to show it, because I think it is completely described by the text above, but this is here:

    Now, it was not that much faster that some of your previous posts, when you refused to your postcode, "guess us" what you wanted (but not to not correctly guess), you tried to "push" us in the right direction (still refuses to post code), and no one seemed very happy?

    Bob Schor

  • How to access a column value in a Select list in a tabular presentation for each line

    Hello

    Environment: Using Oracle APEX v4.2.1 on an Oracle 11 g 2 DB

    In a tabular presentation using the following example query, i.e.:

    select
    "EMPNO",
    "EMPNO" EMPNO_DISPLAY,
    "ENAME",
    "HIREDATE",
    "SAL",
    "DEPTNO",
    "MY_LOV"
    from"#OWNER#"."EMP"
    
    

    I need access to every line of my sub form of table, the EMPNO of this line value, within a list of selection (query based LOV) in the column "MY_LOV."

    So, basically, the MY_LOV column in my table presentation, would be a list of selection (query based LOV) where MY_EMPNO =: EMPNO (first column in the select statement above), for each line of the tabular presentation.

    With the help of a picture ( Tom's Blog ) and assuming 'Deptno' column here is actually my new column, i.e. "MY_LOV, I want to know how this list of selection based on lov query would be able to access each EMPNO down in the form of tables, i.e. 7839, 7698, 7782 etc.?

    overview.png

    Any help would be appreciated.

    Thank you.

    Tony.

    Hi Tony,.

    Take a look at the API APEX_ITEM for LOV

    http://docs.Oracle.com/CD/E37097_01/doc/doc.42/e35127/apex_item.htm#AEAPI208

    Kind regards

    Brad

  • Use: OLD and: NEWS in the triggers without oracle for each line

    I use Oracle 10 g.
    I want to insert a row in the table of the newspaper by each Witch of the query is executed on a table.
    And I want to insert on the line at a table of detailed log for each row changed in a query.
    I want to add modification date and time for each line in the two tables of the newspaper and I want it to be similar.

    So, I'm curious about using old and new variables without using for each row on the creation of the trigger. Is this possible?
    Or maybe I can score some variables static for this query (so sysdate will be the same and some of the Pavilion for the insertion of small newspapers)?
    Or maybe is there other ways to do it?

    LeopoldStoch wrote:
    But if I use sysdate in each trigger and it will update something as my sysdate 100000 lines will be different for different lines but I want it to be time and on the same date.

    Hi Leopold,

    Then today is your lucky day :-): sysdate is the same for all the DML. Even if it takes more than one second:

    SQL> create table rob
      2  ( id int
      3  , creation_date date
      4  )
      5  /
    
    Table created.
    
    SQL> create trigger t
      2  before insert on rob
      3  for each row
      4  begin
      5          :new.creation_date := sysdate;
      6  end;
      7  /
    
    Trigger created.
    
    SQL> set timing on
    SQL> insert into rob (id)
      2   select level
      3     from dual
      4  connect by level <= 10000
      5  /
    
    10000 rows created.
    
    Elapsed: 00:00:00.37
    SQL> set timing off
    SQL> select min(creation_date)
      2       , max(creation_date)
      3    from rob
      4  /
    
    MIN(CREATION_DATE)  MAX(CREATION_DATE)
    ------------------- -------------------
    07-05-2010 09:29:24 07-05-2010 09:29:24
    
    1 row selected.
    

    You can read more here: http://rwijk.blogspot.com/2008/07/sysdate.html

    Kind regards
    Rob.

  • call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. The other rows are based on the entities

    Hi Experts,

    JDeveloper 12.1.3.0.0

    I have a VO based on entity object. With a column of the VO is transient attribute (I created).

    I need to call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. As well as other attributes.

    So can anyone suggest how can I achieve this?

    Thank you

    AR

    I think that you need a stored function (which returns the value) in this case, is not?

    Take a look at:

    https://docs.Oracle.com/CD/B31017_01/Web.1013/b25947/bcadvgen005.htm

    and search for:

    Invoking stored function with only Arguments in

    call your function in the Get attribute and return value accessor...

  • What is the difference in verses apps for each of the programs to purchase and download it?  They are the same thing and they are simply called "apps"?  Are the applications of complete programs?

    What is the difference in verses apps for each of the programs to purchase and download it?  They are the same thing and they are simply called "apps"?  Are the applications of complete programs?

    Yes.

    Adobe uses confusion of terminology in their efforts to explain things.

    Cloud desktop applications are the same as the purchase of the software on disk in the days avant-nuage. for example, the Photoshop Cloud desktop application is the full version of Photoshop CC 2015.

  • How to print 1 page for each line of the numbers worksheet

    Hello... I am trying to print reports of year-end per person and number.

    Is it possible in number to print 1 page for each row of a spreadsheet of numbers?

    Or suggestions?

    Thank you.

    Hi cm,

    This looks like a work of fusion and mailing.

    The merge document would create in Pages, and the cells of merger on this document référenceriez cells in the table in the document numbers.

    See the documentation Pages (on the Help menu) for instructions on the conduct of merger and mailing.

    To do this in only numbers, you would need to put in place a 'table of declaration' on a separate sheet (in the same document as the table containing information) which would accept a customer number (or other key ID for each individual) then use it to determine the line of the main table to retrieve information about this pattern.

    A more precise answer requires a more specific desription of your table structure and the desired form of the instruction to take.

    Kind regards

    Barry

  • Report Classic - Condition evaluated for each line

    APEX 4.2.2

    I see something strange in a classic report area. A report began to fail at runtime with a strange error of incorrect syntax. When I run the page in debug mode, I see the following

    Print column headers

    loop lines: line 30 (s)

    ... Run the statement: begin wwv_flow.g_boolean: = "is not null;

    end;

    ...... Result = false

    ... Run the statement: begin wwv_flow.g_boolean: = "is not null;

    end;

    ...... Result = false

    ... Run the statement: begin wwv_flow.g_boolean: = ' embedded string with a 'apostrophe' is not null;

    end;

    ...... Result = true

    It seems that the APEX engine evaluates a Boolean expression after rendering and each row in the report. And for some strange reason, it is using a piece of data from the result set of the query and is not due to bad syntax introduced by the single quotation mark in the string.

    I have never seen it before. Any idea what's going on?

    Thank you

    Hi Vikas

    Report template customized with the models of the conditional row/column?

    (Sorry for the brevity of the answer but I just get on a plane...)

  • Remove the single record using the Recycle Bin for each line icon

    Hello

    Long ago, I saw in some blog ApEx showing how to remove records using "Trash" image on each line.
    I couldn't find that blog anywhere, but I managed to make an example.

    http://Apex.Oracle.com/pls/OTN/f?p=47888:5:0:no:

    Can you someone please guide me to good links on how to do the same.

    I appreciate for your time.

    Thank you
    Raj.

    Hello
    Here you are:

    http://Apex.Oracle.com/pls/Apex/f?p=19914:10:0:no:

    Best regards
    Fateh
    ------------------------------------------------------
    If you think that my answer was correct or helpful to you, then please check the response as helpful or appropriate.

  • Adding column which gives the serial number for each line in the Bulletin Board

    I use the update version 2 Jdev 11 g.
    I'm the filling of all employees from the emp table ADF table.
    My requirement is to add a column more as the first column and header line which displays the serial number for each serial number of row.the is not available in the table emp in database .i want to generate it dynamically when the data are filled in to ADF table.i don't want not to use the method to get the SQL query rownum. I want to get custom code (in the Managed Bean) or set all of the properties in the subject entity or any other object.

    Published by: sj0609 on September 8, 2009 09:43

    Hello

    Give an id to the table (say 'currRow') varStatus property. Add a column to the table (for example with a text output), then set it to the value of the output text #{currRow.index}.

    Arun-

  • Group repeated for each line column

    How a group column can appear in all the ranks? I have to develop a model of assets of the Group company, GL and Costcenter accounts. How can I make these group columns for each asset rather than appear once for each group?

    Thank you
    SN

    Hello

    in your case, the following should work:







    You see, the code depends on the structure of your of your xml, that's why vetsrini inquired.
    And please: publish a valid xml code in the future

    Concerning
    Rainer

  • For each object, create a new layer and rename it

    Hello!

    I want to export an Illustrator file to DWG, and I have many things I want to keep the name. But to keep this info in AutoCAD, I need to transfer them as layer names (DWG/DXF export does not record the name of the object, but the name of the first level layer) and put all these layers as layers of level first (DWG/DXF export maintains just first layers of level).

    So I would like to make or find a capable script something like this:

    in my file,.

    for each object,.

    see if there is a layer with the name of the object

    If there is any layer with the same name

    then

    Create a layer,

    give the name of the object to the layer

    endif

    Place the object in this layer

    Is there someone who can help me?

    Thank you!

    You can select your layer, then use "Release to layers", which will create a sublayer for each object that you have, and then a script can rename these layers based on the named object it contains... so you can drag them all out of their layer sublayers parent so that they become the main layers... everything that is explained here, including the script

    Selected lap HAVE sublayers in top-level layers?

  • I just bought and downloaded items but Windows ordered by mistake when I need items for Mac. Please cancel the windows and help me get the Mac.

    Please help me to cancel my order of elements for Windows. I have a Mac and want to elements for Mac. Sorry I've been so carefree!

    Return, cancel or change an Adobe order

Maybe you are looking for

  • AppleScript

    I have the following problem with the script editor.  I have a script that goes through a spreadsheet Numbers cell-by-cell and examines the background color for each cell.  If the background color is yellow it it turns green.  I couldn't get this scr

  • How can I keep my Bookmarks Toolbar icons (I tried Deiconizer to bookmarks) even after downloading files?

    I prefer a clean workspace in my browser, I'm looking to get rid of the icons in the bookmarks toolbar. I've been using the bookmarks-Deiconizer (version 2.3) and it works pretty well. When I open Firefox for the first time, but also new windows, ico

  • Behavior of the computer after the conversion of XP

    Hi all! I just upgraded my IdeaPad to Windows XP SP2. (Y510 - 1.83 GHz dual core - 160 GB HDD - 2 GB RAM - nVidia 256MB - Bluetooth - wireless A/G/N) All Lenovo drivers have been installed successfully with the exception of the touchpad (which works

  • VISA series 2012

    Hey all,. I worked with LabVIEW 2011 to develop a program to drive a motor via the VISA series block. I've updated since for 2012, and I had problems to get the LabVIEW program to reward the engine. I have a 3rd third-party program installed that I c

  • After using CNettoyez, disappear the Visual possibilities. Why

    How can I still it