SQL query in two recent documents and make it as a single record

Hi gurus,

My Version of Oracle
BANNER                                                                          
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production          
PL/SQL Release 11.1.0.7.0 - Production                                          
CORE     11.1.0.7.0     Production                                                      
TNS for 32-bit Windows: Version 11.1.0.7.0 - Production                         
NLSRTL Version 11.1.0.7.0 - Production                                          

5 rows selected.
SQL> WITH T AS
  2  (
  3      SELECT 1 ID,'Personal' NAME,2 TYPE,TO_DATE('03/01/2010','MM/DD/YYYY') DT FROM DUAL UNION ALL
  4      SELECT 2,'Personal',2,TO_DATE('02/01/2010','MM/DD/YYYY')  FROM DUAL UNION ALL
  5      SELECT 3,'Personal',2,TO_DATE('05/01/2010','MM/DD/YYYY')  FROM DUAL UNION ALL
  6      SELECT 4,'Shared',1,TO_DATE('04/01/2010','MM/DD/YYYY')  FROM DUAL UNION ALL
  7      SELECT 5,'Shared',1,TO_DATE('03/01/2010','MM/DD/YYYY')  FROM DUAL
  8  )SELECT * FROM T;

        ID NAME           TYPE DT
---------- -------- ---------- ---------
         1 Personal          2 01-MAR-10
         2 Personal          2 01-FEB-10
         3 Personal          2 01-MAY-10
         4 Shared            1 01-APR-10
         5 Shared            1 01-MAR-10

SQL>
I need to get the last drive of the data of each Type group and to get it in a single record.

My desired output:
        ID NAME           TYPE DT      SHARED_ID SHARED_NAME SHARED_DT
---------- -------- ---------- ------------------- -------- ---------- ---------
         3 Personal          2 01-MAY-10         4 Shared            1 01-APR-10

Or

SQL> with t as
(
 select 1 id,'Personal' name,2 type,to_date('03/01/2010','MM/DD/YYYY') dt from dual union all
 select 2,'Personal',2,to_date('02/01/2010','MM/DD/YYYY')  from dual union all
 select 3,'Personal',2,to_date('05/01/2010','MM/DD/YYYY')  from dual union all
 select 4,'Shared',1,to_date('04/01/2010','MM/DD/YYYY')  from dual union all
 select 5,'Shared',1,to_date('03/01/2010','MM/DD/YYYY')  from dual
)
--
--
select max (decode (rownum, 1, id)) id,
       max (decode (rownum, 1, name)) name,
       max (decode (rownum, 1, type)) type,
       max (decode (rownum, 1, dt)) dt,
       max (decode (rownum, 2, id)) s_id,
       max (decode (rownum, 2, name)) s_name,
       max (decode (rownum, 2, type)) s_type,
       max (decode (rownum, 2, dt)) s_dt
from (select t.*, max (dt) over (partition by name) m_dt from t)
where dt = m_dt
/
        ID NAME           TYPE DT               S_ID S_NAME       S_TYPE S_DT
---------- -------- ---------- ---------- ---------- -------- ---------- ----------
         3 Personal          2 05/01/2010          4 Shared            1 04/01/2010
1 row selected.

Tags: Database

Similar Questions

  • using a hp 6500 - how to scan several image documents and keep them in a single image file

    using a hp 6500 - how to scan several image documents and keep them in a single image file instead of hafving to create a separate file for each page?

    http://h30434.www3.HP.com/T5/scanning-faxing-and-copying/HP-OfficeJet-6500-scan-multiple-pages-into-one-PDF-file/TD-p/252650

    This previous thread should help you.

  • (Updated report) SQL query - may not know how to make one

    Hi people,

    Can someone tell me how to make a report where the data can be updated? Not an interactive report, SQL report that selects a single row. The only options in the menu dropdown I see are "SQL query" and 'SQL Query (body of function from PL/SQL returning SQL query)', but I have a report elsewhere that says: this type are "SQL Query (updated report)", but I do not remember how :(

    Thank you very much

    -Adam

    Hi Adam,.

    An updated report is a 'tabular form' - see: http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/frm_tabular.htm#CHDFBHDB

    Andy

  • How to find my recent Documents to make a desktop shortcut for clear all at once

    I have used to have a shortcut to the my recent Documents, but after formatting the PC, I keep on searching in vain, and my recent Documents is full.

    Hi Mohammedhammuri,

    Recent documents are store C:\Documents and Settings\\Recent

    You must activate your computer to show hidden files and folders to achieve (my computer-> tools-> Folder Options-> display-> display files and folders.)

    I hope this helps.

  • SQL query between two table

    Hi all
    Following the script nicely:
    CREATE TABLE ACCOUNT_LOOCKUP
    (
      SERIAL_ID     NUMBER,
      ACCOUNT_ID    NUMBER,
      ACCOUNT_RATE  NUMBER,
      ACCOUNT_MAX   NUMBER
    )
    
    ALTER TABLE ACCOUNT_LOOCKUP ADD (
      CONSTRAINT PK_ACCOUNT_LOOCKUP
     PRIMARY KEY
     (SERIAL_ID, ACCOUNT_ID));
    
    
    
    Insert into ACCOUNT_LOOCKUP
       (SERIAL_ID, ACCOUNT_ID, ACCOUNT_RATE, ACCOUNT_MAX)
     Values
       (1, 1, 10, 200);
    Insert into ACCOUNT_LOOCKUP
       (SERIAL_ID, ACCOUNT_ID, ACCOUNT_RATE, ACCOUNT_MAX)
     Values
       (2, 1, 12, 150);
    Insert into ACCOUNT_LOOCKUP
       (SERIAL_ID, ACCOUNT_ID, ACCOUNT_RATE, ACCOUNT_MAX)
     Values
       (3, 1, 8, 400);
    Insert into ACCOUNT_LOOCKUP
       (SERIAL_ID, ACCOUNT_ID, ACCOUNT_RATE, ACCOUNT_MAX)
     Values
       (1, 2, 7, 100);
    Insert into ACCOUNT_LOOCKUP
       (SERIAL_ID, ACCOUNT_ID, ACCOUNT_RATE, ACCOUNT_MAX)
     Values
       (2, 2, 5, 200);
    COMMIT;
    
    
    SELECT * FROM ACCOUNT_LOOCKUP
    
     SERIAL_ID ACCOUNT_ID ACCOUNT_RATE ACCOUNT_MAX
    ---------- ---------- ------------ -----------
             1          1           10         200
             2          1           12         150
             3          1            8         400
             1          2            7         100
             2          2            5         200
             
             
    CREATE TABLE ACCOUNT_AMOUNT(
    ACCOUNT_ID NUMBER(10),
    ACCOUNT_AMNT NUMBER(10))
    
    
    Insert into ACCOUNT_AMOUNT
       (ACCOUNT_ID, ACCOUNT_AMNT)
     Values
       (1, 9);
    Insert into ACCOUNT_AMOUNT
       (ACCOUNT_ID, ACCOUNT_AMNT)
     Values
       (1, 35);
    COMMIT;
     
    SELECT * FROM ACCOUNT_AMOUNT
     
    ACCOUNT_ID ACCOUNT_AMNT
    ---------- ---------------
             1               9
             1              35
           
    I want by select query calculte ACCOUNT_TOTAL every ACCOUNT_ID exists in table ACCOUNT_AMOUNT as below ,
    
    1. every ACCOUNT_ID have SERIAL_ID and ACCOUNT_RATE and ACCOUNT_MAX in table ACCOUNT_LOOCKUP,
    2. to calculte ACCOUNT_TOTAL every ACCOUNT_ID : 
       
       - order ascending SERIAL_ID exists in table ACCOUNT_LOOCKUP to every ACCOUNT_ID exists in table ACCOUNT_AMOUNT ,
       - make sum ACCOUNT_AMNT every ACCOUNT_ID in table ACCOUNT_AMOUNT,
       - then, copmare result (sum ACCOUNT_AMNT) with first record after ascending SERIAL_ID,
       - product (sum ACCOUNT_AMNT) * ACCOUNT_RATE  result as ACCOUNT_TOTAL,(in ex: sum ACCOUNT_AMNT  = 44   ) ,
       - if ACCOUNT_TOTAL > ACCOUNT_MAX then 
             * ACCOUNT_TOTAL = ACCOUNT_MAX for first record(in ex SERIAL_ID = 1 ) ,
             * Goto the second record by ascending (in ex SERIAL_ID = 2 ) ,
               make ( ACCOUNT_TOTAL / ACCOUNT_RATE ) for first record ,
               ( 200 / 10 ) result 20 >>
               
             * calculate Remainder ACCOUNT_AMNT =  the sum ACCOUNT_AMNT 44 - 20 = 24 
             
                *Goto the second record by ascending (in ex SERIAL_ID = 2 ) ,   
                   Remainder ACCOUNT_AMNT 24 * (12) ACCOUNT_RATE for second record = 288 as ACCOUNT_TOTAL 
                   -if ACCOUNT_TOTAL > ACCOUNT_MAX then 
                   * ACCOUNT_TOTAL = ACCOUNT_MAX for second record(in ex SERIAL_ID = 2 ) ,
                      * Goto the third record by ascending (in ex SERIAL_ID = 3 ) ,
                      make ( ACCOUNT_TOTAL / ACCOUNT_RATE ) for second record ,
                       ( 150 / 12 ) result 12.5
                   
                        * calculate Remainder ACCOUNT_AMNT =  the sum ACCOUNT_AMNT 24 - 12.5 = 11.5 
                        Remainder ACCOUNT_AMNT 9.5 * (12) ACCOUNT_RATE for third record = 92 result as ACCOUNT_TOTAL 
                        if result <= ACCOUNT_MAX then 
                            ACCOUNT_TOTAL = 92 
    except result
    ------------
    
    SERIAL_ID ACCOUNT_ID ACCOUNT_RATE ACCOUNT_MAX   ACCOUNT_TOTAL          ** explain ** 
    ---------- ---------- ------------ -----------  -------------  *****  sum ACCOUNT_AMNT  = 44 for ACCOUNT_ID = 1from table ACCOUNT_AMOUNT ******
             1          1           10         200          200  >> (44 * 10 ) = 440 >>  200 /10 rate = 20 >> 44 - 20 = 24 Remainder ACCOUNT_AMNT
             2          1           12         150          150  >> (22 * 12 ) = 288 >>  150 /12 rate = 12.5 >> 24 - 12.5 = 11.5 Remainder ACCOUNT_AMNT
             3          1            8         400           92  >> (11.5 * 8)  = 92  And so on ....
        
    another insert 
    Insert into ACCOUNT_AMOUNT
       (ACCOUNT_ID, ACCOUNT_AMNT)
     Values
       (2, 10);         
       
       
    SELECT * FROM ACCOUNT_AMOUNT
     
    ACCOUNT_ID ACCOUNT_AMNT
    ---------- ---------------
             1               9
             1              35
             2              10    
             
    
    except result
    ------------
      
    
    SERIAL_ID ACCOUNT_ID ACCOUNT_RATE ACCOUNT_MAX   ACCOUNT_TOTAL          ** explain ** 
    ---------- ---------- ------------ -----------  -------------  *****  sum ACCOUNT_AMNT  = 10 for ACCOUNT_ID = 2 from table ACCOUNT_AMOUNT ******
             1          1           10         200          200  
             2          1           12         150          150  
             3          1            8         400           92           
             1          2            7         100           70    10 * 7 = 70 
    Help me please
    Thanks in advance

    Hello

    Please do not post duplicate questions.

    calculate the value of the query help

    David

  • Developer SQL stop writing in c:\documents and settings\

    Hello

    does anyone know how I can change the directory where sql developer written under windows?
    Currently, it is written to c:\document and settings\... (my % APPDATA % path in windows).
    I have quotas on my profile and quotas are exceeded by SQLDeveloper.

    Kind regards
    Marcus

    Published by: user12019413 on February 3, 2010 06:33

    If you want to change the directory where the configuration SQLDeveloper, files are saved you can add:

    AddVMOption - Dide.user.dir = DIRECTORY_YOU_LIKE

    at SQL_DEV_INSTALL_DIR/sqldeveloper/bin/sqldeveloper.conf

  • Can I insert image into the existing identity document and make the text flow around it?

    I now get text properly formatted in InDesign CS4.  Is it possible for me to add pictures to this already existing document and that the text automatically adjust to autour flow of these images comes to be inserted?

    Thank you

    Just use File > place command to add your photos. Edition > clear all before do you.

    After you have placed your images, select them using the Selection (black arrow) tool, choose window > text wrapping and text wrap. After that, the text flows around this image when you take on the top of the text.

  • How to put in place two sound devices and make two of them work at the same time?

    I am on Windows 7 Ultimate and I have a problem...

    I downloaded the SRS Audio Essentials software that improves the sound quality

    And I have Realtek audio device which is an audio driver that come with bulit in sound card

    But the problem is that I can choose only one of them as the default audio device

    When I was with Windows Xp, two of them worked at the same time...

    He is the captain:

    http://www.Flickr.com/photos/96392754@N07/8812378555/

    Help, please!

    PS: Sorry for my bad English... ^_^

    Hello

    Unfortunately this does happen, as it is by design,

    Here, a single device can be marked as default device, follow these steps below for more information.

    a. Click Start, type Sound in the box to start the search.
    b. click sound in the results of search at the top of the start menu.
    c. click the reading notice the check mark next to the default device.

    For all windows questions do not hesitate to contact us and we will be happy to help you.

  • Can I add multiple documents to the signature of a single record EchoSign?

    If my client is a television network, and they want to sign individual agreements for all of their affiliates, can I add all those separate agreements to an email? Or the customer must obtain an email separately for each station agreement? For example, Customer Contact even get 50 emails (for the 50 affiliated stations), coming one after the other and say 'sign this Document. EchoSign supports uploading multiple documents to a recording of "agreement"? Otherwise, the process of 'ease of use' electronic signature could backfire a lot of time...

    Hello

    Yes, you can add separate email agreements. EchoSign will automatically add the documents in a single transaction, then you can manually place the signature for each agreement fields separately.

    You can attach a total of 100 pages and size should be 10 MB or less (can be adjusted according to the type of subscription).

    Kind regards

    Mohamed

  • I can't find my favorite gadget 'Office Recent Documents?

    I had a virus and she erased everything.  Now when I went to set up my sidebar as I wanted.  I can not find two of my main gadgets that I have used for the last 3 years.  "Recent documents" and the old gadget "notes."  Is it possible to download them again?  It seems that the options for the gadgets with Vista has disappeared.

    Hello

    -Are you talking to a third-party Sidebar?

    If you are referring to a third party of sidebar, you may search using your search engine.

    If you are referring to the Windows Sidebar and gadgets, you can follow without refer to this article.

    http://Windows.Microsoft.com/en-us/Windows-Vista/Windows-Sidebar-and-gadgets-overview

    WARNING OF THIRD PARTY
    Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

  • PL Sql Query Builder Tool

    Hello

    Is there any Pl/Sql Query Builder tool / software that can make your life easier.

    best regards

    Sandy

    SPathak wrote:

    Hello

    I agree, that oracle Pl/Sql is powerful and gives a correct result.

    little time to create a complex query with assistant was looking for easy way.

    Sandy

    You will not learn using a GUI like TOAD tool (and I LOVE TOAD).  I always write by hand in the editor, instead of drag / drop regardless of what type of gui tool.  Only, I do not use the constructors unless you are a business analyst who has no experience of SQL.

  • How to generate a Word document and a PDF file of help files?

    Hello

    I'm new to RoboHelp HTML and uses version 8.  I've updated some help files, and now I want to generate the output.  Here are my questions / or the process that I used:

    • To compile the help, I clicked on generate a main page layout.  Is this correct?  I noticed that the stamp on the xpj file has not changed.  The date is still many months.  (Why is this?  Must show a recent update date?)  However, the files that I've updated reflect the dates when I did the updates.  It comes to files art, a high hydrostatic pressure and htm, js, ldb, pss, DPC files.
    • To generate a pdf file, I clicked on Generate PDF.  I was not able to generate the PDF file first, but then I enabled macros in Word 2007 (Trust Center settings > enable all macros.. .and clicked on the checkbox, approved access to the VBA project object model) and you click on Generate the PDF.  At the end of the generation, I got this error in Word: Microsoft Office Word has encountered a problem and needs to close.  We are sorry for the inconvenience.  The news that you were working may be lost.  Word can try to recover it for you.  I closed the Word and dialog box generated several blank documents.  Microsoft Office Diagnostics was performed and found a problem and fixes it.  Despite the error message was generated a pdf file.  (If you could give me any idea on why I got error messages, which could be useful to know).
    • How to generate a Word document?

    Thank you!

    Erin

    Welcome to the forum.

    I would suggest a different workflow.

    When you select generate a main page layout, RoboHelp did this according to the settings in all that is attached to your main layout. Better at least first double-click the page layout so that you see the settings and can make a difference to the way you want. After that, you can use generate a main page layout if you want, but I'd rather go through the layout itself and check the settings.

    The XPJ file changes only when certain things should be recorded in it and it's not every time that you are working on the project. In other words, don't worry about the date of the file.

    Now for the PDF. Again not the best place to start and still better to go of the provision itself. You can try to simply generate a PDF file, but many users prefer to create a Word document and make some changes in that. It can just be put page breaks to improve appearance, it may be more, it's your call. Once the Word document is good, generate the PDF from there.

    You will find the page layouts, that I want to talk in the pod of single Source Layouts. View > pods.

    See www.grainge.org for creating tips and RoboHelp

    @petergrainge

  • Microsoft Word 2016 do not open recent documents

    In my previous version of Word, when I launched it would open all the docs that have been left open, when I left. It was really great for helping me to remember what I was working on when I stopped changed my Mac.

    It seems to be controlled in the system preferences of Mac (not in MS Word preferences.) In the General preferences pane, I deselected 'Close the windows when you exit an application', but still it does not reopen what was open when I quit Word. I have to go in my recent documents and reopen all individually in my last session.

    Someone knows how to fix this? (This does not really seem like the community just to publish on, but I can't seem to find an appropriate place.)

    If it is not a direct solution, if you have the word preserved in the Dock, even when closed, you can right-click on it to get the list of recently used files and open like that.

  • SQL query must count number of engaged, end, MEP per month

    Hi all

    Need Sql query with group by category and count of the PEM attached, terminated, current for every month for the year.

    Create table per_all_people_f
    (person_id varchar2(30),
    original_date_of_hire date)
    
    Create table per_all_assignments_f
    (person_id varchar2(30),
    employee_category varchar2(30))
    
    create table per_periods_of_service
    (person_id varchar2(30),
    actual_termination_date date)
    
    insert into per_all_people_f
    values(1,to_date('01-FEB-2014','DD-MON-YYYY'));
    /
    insert into per_all_people_f
    values(2,to_date('10-FEB-2014','DD-MON-YYYY'));
    /
    insert into per_all_people_f
    values(3,to_date('10-dec-2013','DD-MON-YYYY'));
    /
    insert into per_all_people_f
    values(4,to_date('10-MAR-2014','DD-MON-YYYY'));
    /
    insert into per_all_people_f
    values(5,to_date('10-dec-2013','DD-MON-YYYY'));
    /
    
    
    insert into per_all_assignments_f
    values(1,'ADMIN');
    /
    insert into per_all_assignments_f
    values(2,'TECH');
    /
    
    insert into per_all_assignments_f
    values(3,'TECH');
    /
    insert into per_all_assignments_f
    values(4,'ADMIN');
    /
    
    insert into per_all_assignments_f
    values(5,'ADMIN');
    /
    
    insert into per_periods_of_service
    values(3,to_date('05-feb-2014','DD-MON-YYYY'));
    /
    
    
    
    
    
    
    
    
    
    

    Desired output.  "()" are to explain only.

    Explanation of columns:

    Hired_ADMIN = used category ADMIN

    Term _Admin = employee fired from category ADMIN

    Current_ADMIN = Total current employees in category ADMIN

    Hired_TECH = used in category TECH

    Term_TECH = employee fired in category TECH

    Current_TECH = Total current employees in category TECH

                      
    
                 
    Month        Hired_ADMIN   Term_ADMIN     Current_ADMIN                        Hired_TECH    Term_TECH      Current_TECH
    
    
    Jan-14          0             0                1                                   0            0                10 (example)
    Feb-14         2              1                2                                   0            1                 9
    
    
    
    

    Tried the queries below: but not able to get the desired output grouping...

    I made different requests for In (Hired), Out (Terminated), need help for current employees by month and grouping as stated above the desired output.

    1 request for employees

    
    
    select in_month,in_month_name
             , count(decode(employee_category,'ADMIN', person_id)) ADMIN_IN
             --, count(decode(employee_category,'DOCT', person_id)) DOCT_IN
             --, count(decode(employee_category,'NURS', person_id)) NURS_IN
             , count(decode(employee_category, 'TECH', person_id)) TECH_IN
    from
    (
    select distinct
    papf.person_id,
    paaf.employee_category,
           trunc(papf.original_date_of_hire, 'mm') in_month,
           decode(userenv('LANG'),'US',to_char(papf.original_date_of_hire, 'Month'),'AR',to_char(papf.original_date_of_hire, 'Month','nls_date_language=Egyptian'),'') in_month_name
          from per_all_people_f papf
          ,per_all_assignments_f paaf
          where papf.person_id = paaf.person_id
          and Papf.ORIGINAL_DATE_OF_HIRE between to_date('01-JAN-'||:P_YEAR) and to_date('31-dec-'||:P_YEAR)
          and paaf.employee_category is not null         
           )           
         group
          by in_month,in_month_name  
         ORDER BY  in_month
    
    
    
    

    2. request for completed employees:

    select out_month,out_month_name
             , count(decode(employee_category,'ADMIN', person_id)) ADMIN_OU
             --, count(decode(employee_category,'DOCT', person_id)) DOCT_OUT
             --, count(decode(employee_category,'NURS', person_id)) NURS_OUT
             , count(decode(employee_category, 'TECH', person_id)) TECH_OUT
    from
    (
    select distinct
           papf.person_id,
           paaf.employee_category,
           trunc(actual_termination_date,'mm') out_month,
           decode(userenv('LANG'),'US',to_char(actual_termination_date, 'Month'),'AR',to_char(actual_termination_date, 'Month','nls_date_language=Egyptian'),'') out_month_name
          from per_all_people_f papf
          ,per_all_assignments_f paaf
          ,per_periods_of_service ppos
          where papf.person_id = paaf.person_id
          and ppos.person_id = papf.person_id
          and ppos.actual_termination_date between to_date('01-JAN-'||:P_YEAR) and to_date('31-dec-'||:P_YEAR)
          and paaf.employee_category is not null             
           )           
         group
          by out_month,out_month_name  
         ORDER BY  out_month
    
    
    
    

    Pls suggest the sql query for current employees monthly and Hired of the EMP, Terminated the PEM group, according to the current EME Emp_Category.

    Please suggest...

    Thanks and greetings

    Afzal.

    Post edited by: 1002933

    Try this:

    set line 1000
    
    WITH dt AS
            (SELECT TO_DATE ('01/' || LEVEL || '/' || &p_year, 'dd/mm/yyyy')
                       st_dt
               FROM DUAL
             CONNECT BY LEVEL <= 12)
    SELECT mnth
          ,hired_admin
          ,term_admin
          ,hired_admin - term_admin current_admin
          ,hired_tech
          ,term_tech
          ,hired_tech - term_tech current_tech
      FROM (SELECT TO_CHAR (st_dt, 'mon-yy') mnth
                  , (SELECT COUNT (*)
                       FROM per_all_people_f h, per_all_assignments_f c
                      WHERE h.person_id = c.person_id
                        AND c.employee_category = 'ADMIN'
                        AND h.original_date_of_hire BETWEEN st_dt
                                                        AND LAST_DAY (st_dt))
                      hired_admin
                  , (SELECT COUNT (*)
                       FROM per_all_people_f h
                           ,per_all_assignments_f c
                           ,per_periods_of_service s
                      WHERE h.person_id = c.person_id
                        AND c.employee_category = 'ADMIN'
                        AND h.person_id = s.person_id
                        AND s.actual_termination_date BETWEEN st_dt
                                                          AND LAST_DAY (st_dt))
                      term_admin
                  , (SELECT COUNT (*)
                       FROM per_all_people_f h, per_all_assignments_f c
                      WHERE h.person_id = c.person_id
                        AND c.employee_category = 'TECH'
                        AND h.original_date_of_hire BETWEEN st_dt
                                                        AND LAST_DAY (st_dt))
                      hired_tech
                  , (SELECT COUNT (*)
                       FROM per_all_people_f h
                           ,per_all_assignments_f c
                           ,per_periods_of_service s
                      WHERE h.person_id = c.person_id
                        AND c.employee_category = 'TECH'
                        AND h.person_id = s.person_id
                        AND s.actual_termination_date BETWEEN st_dt
                                                          AND LAST_DAY (st_dt))
                      term_tech
              FROM dt);
    

    Output:

    Enter the value of p_year: 2014

    old 1: WITH dt AS (SELECT TO_DATE ('01 /' |)) LEVEL | '/' || & p_year, ' dd/mm/yyyy') st_dt

    new 1: WITH dt AS (SELECT TO_DATE ('01 /' |)) LEVEL | '/' || 2014, ' dd/mm/yyyy') st_dt

    MNTH HIRED_ADMIN TERM_ADMIN CURRENT_ADMIN HIRED_TECH TERM_TECH CURRENT_TECH

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

    Jan-14                    0          0             0          0          0            0

    Feb-14                    1          0             1          1          1            0

    Mar-14                    1          0             1          0          0            0

    Apr-14                    0          0             0          0          0            0

    May-14                    0          0             0          0          0            0

    Jun-14                    0          0             0          0          0            0

    Jul-14                    0          0             0          0          0            0

    Aug-14                    0          0             0          0          0            0

    Sep-14                    0          0             0          0          0            0

    Oct-14                    0          0             0          0          0            0

    Nov-14                    0          0             0          0          0            0

    MNTH HIRED_ADMIN TERM_ADMIN CURRENT_ADMIN HIRED_TECH TERM_TECH CURRENT_TECH

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

    Dec-14                    0          0             0          0          0            0

    12 selected lines.

  • Recent documents is not updated?

    Well, since I updated to the new Photoshop CC 2015 (the last big update), whenever I open it, it shows me the same list of recent documents. This list is not accurate at all. I use recent Documents all the time, so it's really disturbing my workflow, as I tend to work with dozens of documents per day.

    Hi adamssamg,

    Suggest you to reset the list of recent documents and restart Photoshop.

    Go to the file menu > open recent item > clear recent file list.

Maybe you are looking for