How to extract the number and other particulars

I am trying to write a simple Select query that returns a list of
Used EMPLOYEE_TABLE and in the second column names a count of the
number of entries for each employee in the EMPLOYEE_ATTENDANCE table.

Can anyone suggest how I might do this?

For example:
I have two tables EMPLOYEE_TABLE and EMPLOYEE_ATTENDENCE.

EMPLOYEE_TABLE:

emp_number emp_name
1A
2B
3 C
4 D

EMPLOYEE_ATTENDENCE:

emp_number emp_time
1 8.00
1 8.00
1 8.00
4 8.00
4 9.00
4
4
4
3
3
3
2




Now my requirement is I want to retrieve the list of employees with emp_name and the number of days
the employee came (ie the number of entries in the EMPLOYEE_ATTENDENCE table).
Some, such as:

A 3
B 1
A q
D 5

Select
a.emp_name, b.emp_attendence
Of
Employee_Name has,
(select emp_number, count (emp_number) "emp_attendence" of the employee_attendence by employee_number group) b
where a.emp_number = b.emp_number;

Kind regards
Navneet

Tags: Database

Similar Questions

  • I downloaded a free trial of Adobe Creative cloud and dreamweaver CC. I am not able to download a .psd to see how to extract the HTML and CSS.

    I downloaded a free trial of Adobe Creative cloud and dreamweaver CC. I am not able to download a .psd to see how to extract the HTML and CSS.

    Download button is disabled. What is the case for a free trial?

    Hey girijamg,

    I asked that you try to open a page because snippet Panel will be disabled until there is a html page is open in DW.

    Excerpt from Panel will be ready for the job that after any html page is open in DW.

    Hope it makes sense.

    Lalita

  • How to clean the fan and other components?

    Pavilion 1201tx g6.

    The ideal temperature for my g6 are as follows:

    Is it normal when the ambient temperature is ~ 28 degrees Celcius? (Location: Mumbai, India).

    Should I clean the fan and other components by disassembling g6?
    Please give me some official guide PDF or videos.
    My laptop is out of warranty. Technician of cleaned HP laptop and applied thermal paste 9 months ago.

    Please help, very important.


    ____________________________
    | Please hit Kudos, if I help you! |
    | |
    | WILL |
    |___________________________|

    Hello

    Please see the following article:

    http://www.PCWorld.com/article/2021499/how-to-clean-your-laptops-cooling-fans.html

    and video:

    http://www.YouTube.com/watch?v=0yyEVSkz_0M

    And the next book shows you how to open and close the machine:

    http://h10032.www1.HP.com/CTG/manual/c02770249.PDF

    Kind regards.

  • How to get the number and the name of the contacts selector

    Hi all

    I got the Contact Picker work but I have no idea how to get the selected telephone number and the name.

    There are attributes that I can put like contactId.value () to retrieve or there is another way?

    Thanks in advance.

    ImageButton{
                        defaultImageSource: "asset:///images/bluebutton.png"
                        onClicked: {
                            contactPicker.open();
                        }
                        attachedObjects: [
                            ContactPicker {
                                id: contactPicker
                                onContactSelected: {
                                    result.text = "You chose contact: " + contactId;
                                }
                            }
                        ]
    
                    }
    
                    Label {
                        id: result
                        text: "You chose contact: "
                    }
    

    Hello

    You can get the contact name and phone number as this,

    ImageButton{
                        defaultImageSource: "asset:///images/bluebutton.png"
                        onClicked: {
                            contactPicker.open();
                        }
                        attachedObjects: [
                            ContactPicker {
                                id: contactPicker
                                onContactSelected: {
                                    result.text = "You chose contact: " + contactId;
    // call a cpp method to get the details
    
    app.getDetails(contactId); } } ] } Label { id: result text: "You chose contact: " }
    

    the CPP code:

    void ContactDetails(ContactId id)
    {
    Contact contact_info = m_contactService->contactDetails(id);
    
        QString firstName = contact_info.firstName();
        QString lastname = contact_info.lastName();
            QList phoneno_list = contact_info.phoneNumbers();
    
        QStringList no_s;
    
        foreach(ContactAttribute attr, phoneno_list)
        {
            no_s << attr.value();
        }
    }
    

    You can get details like this.

    Kind regards

    Naresh Kodumuri.

  • OpenScript: How to extract the StepName and StepResult to an external file

    Hello

    We try to capture the results of the tests in an external file (excel sheet) at the level of the group stage. Y at - there any built-in function/API that could be used to capture the StepName and the StepResult?


    Kind regards
    Nishant

    Hi Nishant,

    Try to use getStepResult () .getCommentString () and getStepResult () .getOutcome ().

    See you soon,.
    Jamie

  • How to trace the number and string in a line (meter data via MODBUS recorder)?

    Hi all I did the log data amount using digital via modbus (RS485) meter to monitor how much and to reject what has and name operator, Machine and the part number.

    I have problem on plot number & string in one line, as shown in the image below:

    How to move this channel on a line? I enclose my vi.

    Thank you ~.

    Hi rhiesnand,

    at the moment you add 2 new lines in your table.

    The solution is to concatenate the two parts of the line to a greater range of 1 d before adding this table as a new row to your table 2D!

    Like this:

  • How to convert the number and time of storage in my table

    Hai all

    I have a table called present in that certain fields are

    Code varchar

    Name varchar

    Date of the respondent

    outtime date

    eTime number

    number of wtime

    number of cutmin


    SO I Wtime calculated by Outtime sub - intimate and now I need to calculate the time additional IE Etime

    So for all employees working hours are 0830 so I need for less 0830 train employees working hours

    How can I convert this at 0830 and sub with Wtime and to get the exact time


    Thanks in advance

    srikkanth. M

    Hello!

    Outtime - intimate is a figure which means days

    0830 8.5 hours and that's 1/24 * 8.5 days.

    Lets say I work today between 0700 and 1510

    Follow my example

    SQL> with data as (
      2    select to_date('02.04.2010 15:10','DD.MM.YYYY HH24:MI') outdate ,
      3           to_date('02.04.2010 07:00','DD.MM.YYYY HH24:MI') indate ,
      4           1/24 * 8.5 need_to_work from dual )
      5  select round((outdate - indate - need_to_work) * 1444) etime_in_minutes from data
      6  /
    
    ETIME_IN_MINUTES
    ----------------
                 -20
    
    SQL> 
    

    Again you can now convert minutes to hours or test whether etime is negative or what...

    Then in your case update statement would be

    update attendance set etime = round((outtime - intime - 1/24*8.5) * 1444) where 
    

    T

    Published by: ttt on 1.4.2010 22:17

  • How to limit the salaries and other writings of assignment

    Hello

    I want to create a liability for users of human resources, that I need to restrict user access to see other entries of salary and elements or no details to earn an income.

    Please can anyone provide steps or give an idea to do.

    Thank you

    Mohsin

    Check these topics-

    Re: Can we limit the responsibilities element

    Re: Exclude the item entry screen.

  • How to share the use and other files

    2 computers. 1 network (actually a dropbox folder).

    Tiara 2014

    What is the best way to make a facility within the tiara 2 computers can share dataplugins and saved view, report, script files?

    Navigator th was easy as just point it to the data of the index folder.

    I want to just make sure I hit all the appropriate configurations. SLEEP well, my stumble faced the Dataplugins.

    -Scott

    Hi Scott,.

    If you happen to use the DataFinder server, and if you are using only VBScript DataPlugins, then there is a function to automatically synchronize each connected DIAdem or LabVIEW client DataPlugins with versions updated on the DataFinder Server computer.

    If you use DataPlugins from www.ni.com/dataplugins, then you can have a VBScript that run at startup to check the local version of use compared to the version updated to www.ni.com/dataplugins and download the new version when it is available.

    If you use DataPlugins, you have created yourself, so the only thing I can think is to have a VBScript that run at startup that runs automatically the file *.uri every time that DIAdem launches, although having your use up-to-date on shared DropBox may prevent this option.

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • How to get the name and number of the procedure parameter list or a function?

    I stated the procedure described in the package

    If I want to get the number and the name of the parameter list, so how do I it

    I don't have I her name with the package.

    create or replace package demoApp is

    PROCEDURE insert_data (p_fname IN VARCHAR2,

    p_lname IN VARCHAR2,

    p_address IN VARCHAR2,

    p_cellno IN VARCHAR2,

    p_email IN varchar2);

    end demoApp;

    create or replace package demoApp body is

    PROCEDURE insert_data (p_fname IN VARCHAR2,

    p_lname IN VARCHAR2,

    p_address IN VARCHAR2,

    p_cellno IN VARCHAR2,

    p_email IN varchar2) IS

    EmpID number;

    BEGIN

    Select nvl (max (emp1.empid), 0) + 1 in EMP1 empid;

    INSERT INTO VALUES EMP1 (empid, p_fname, p_lname, p_address, p_cellno, p_email);

    EXCEPTION

    WHILE OTHERS THEN

    raise_application_error (-20001,' insert the problem ' |) SQLERRM);

    END;

    end demoApp;

    -----------------

    I want to get the name of the parameter and the number of use of stroredrprocedure ""demoApp.insert_data " "

    Select *.

    of all_arguments

    where package_name = 'DEMOAPP.

    and object_name = 'INSERT_DATA.

  • Special characters other than the number and the hyphen

    Hi all

    I have a table that has a column named ID. This column contains the employee id, but during the loading of the files in the Tables, some records are contains various special characters. The sould IF contains number and hyphen (-) only. All other characters are special characters.

    I need to write a procedure/function, where I spend that id and check in the table if this ID contains special characters other than the number and the dash and remove it and then check the length of it (say 10).

    It should then resubmit this comment to refer to another ID such as "invalid ID".

    Can someone help me how to write the procedure/function with this feature?
    with t1 as(
    select '12345-2345 ' val from dual
    union
    select '34556- 5627'  from dual
    union
    select ' 56556-5236'  from dual
    union
    select '11111-1111' from dual
    ) select regexp_substr(val,'^[0-9]+-[0-9]+$') FROM t1
    where regexp_substr(val,'^[0-9]+-[0-9]+$') is not null
    
  • How to extract 1 ASA and put them in the new table

    Hello

    Can someone tell me how to extract a table and put in the new table. (eg. I have a table with no 1 to 1000, I would extract only 1, 30, 60, 90,...)  ?

    Please advise me.

    Thank you

    concerning


  • I tried several times using IE, Chrome and Firefox browsers (win) to download the files for Indesign CS6 - all of these attempts have failed to extract the files. Other parts of the plant extract successfully, so I don't think I have

    I tried several times using IE, Chrome and Firefox browsers (win) to download the files for Indesign CS6 - all of these attempts have failed to extract the files. Other parts of the plant extract successfully, so I don't think that's my machine or OS (Win 7 Pro). I have been fighting for three days and am losing patience fast. Advice or assistance will be appreciated.

    I finally got it to work using a different machine and copy the files on a USB stick for transfer to the machine I need installed on!

  • Difficulty for the inhibition of the mouse and other 'clicks' does not

    I followed the procedure described for the inhibition of the mouse and other clicks in Internet Explorer (model sounds, set Start Navigation and window block pop-up 'None', click OK), but the clicks continue.  When I call to the top of the window of his plan once again, the speakers are back next to Start browsing and Popup window blocked.  How to make it so that just listening to music is the only sound?

    Start > Control Panel > sounds & Audio > sounds tab and disable these windows sound you want / need.

    TO return to your pop-up windows, disable the blocker.

    By doing this, you can have a gogo advertising. That being said, if the site that you are using ActiveX controls for pop-up windows, you should get a choice to accept or decline their of this particular Web site (between the main window of IE and the toolbar).

    See you soon,.

    Jerry

  • How to count the number of nodes under each parent in any given xml

    How to count the number of nodes under each parent in any given xml. for example the xml below was
    books has 3 childern, library [1] has 4, [2] library has 6 and bookshop [3] has 2. is it possible to get the number of tags in a childnode duplicate IE library [1]
    Book1 Tagus repeated twice... vice versa. do we need to make plsql lie we can achieve through sql

    < book >
    < library >
    ABC < book1 > < / book1 >
    BCA < book2 > < / book2 >
    ACR < book1 > < / book1 >
    Lac < Book4 > < / Book4 >
    < / book >
    < library >
    ABC < book1 > < / book1 >
    BCA < book2 > < / book2 >
    ACR < book3 > < / book3 >
    ACR < book3 > < / book3 >
    tray of < bookn_1 > < / bookn_1 >
    adjusted cost base < bookn > < / bookn >
    < / book >
    < library >
    ABC < book1 > < / book1 >
    BCA < book2 > < / book2 >
    < / book >
    < / books >


    I tried this... query.

    Select
    XMLQUERY ('count($doc/Books/Bookstore[1]/descendant::*)' in the way of xmltype ("< books >
    < library >
    ABC < book1 > < / book1 >
    ACR < book1 > < / book1 >
    Lac < Book4 > < / Book4 >
    < / book >
    < library >
    ABC < book1 > < / book1 >
    BCA < book2 > < / book2 >
    < / book >
    (< / books > ')
    as 'doc' of happy return) .getNumberVal () as node_count
    of the double

    Select
    XMLQUERY ('count($doc/Books/descendant::*)' in the way of xmltype ("< books >
    < library >
    ABC < book1 > < / book1 >
    ACR < book1 > < / book1 >
    Lac < Book4 > < / Book4 >
    < / book >
    < library >
    ABC < book1 > < / book1 >
    BCA < book2 > < / book2 >
    < / book >
    (< / books > ')
    as 'doc' of happy return) .getNumberVal () as node_count
    of the double

    How can I get the counts for each parent in a single query

    Published by: user7955917 on August 24, 2012 07:26

    Generic function how you want the query to be.

    If the structure is known in advance, as in your example a 'books' and then a 'library' root element, it's as simple as:

    SQL> select x1.parent_id, x2.child_name, count(*)
      2  from tmp_xml t
      3     , xmltable(
      4         '/books/bookstore'
      5         passing t.object_value
      6         columns parent_id   for ordinality
      7               , child_list  xmltype path '*'
      8       ) x1
      9     , xmltable(
     10         '/*'
     11         passing x1.child_list
     12         columns child_name varchar2(30) path 'name()'
     13       ) x2
     14  group by x1.parent_id, x2.child_name
     15  order by x1.parent_id, x2.child_name
     16  ;
    
     PARENT_ID CHILD_NAME                       COUNT(*)
    ---------- ------------------------------ ----------
             1 book1                                   2
             1 book2                                   1
             1 book4                                   1
             2 bookn                                   1
             2 bookn_1                                 1
             2 book1                                   1
             2 book2                                   1
             2 book3                                   2
             3 book1                                   1
             3 book2                                   1
    
    10 rows selected
     
    

    If you want a generic solution that works without knowledge of the structure, you will need a recursive approach, and most importantly, you should know which nodes in distinct, I suppose that the leafs?

    Also, please help if you can provide the link of reference on the function name() years what are the other expression, that I can use after the path

    You can start reading the documentation: http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb_xquery.htm#CBAGCBGJ

    The clause PATH expects a XQuery expression however before 11.2, we can put only simple XPath expressions.

Maybe you are looking for