What better union all or create a separate slider

Hi gurus

I wonder if someone can help out me of this union is a good option, or create a separate slider for each union all is a good option. Which is preferable? Thanks in advance

Concerning

Shu

You can use Union all instead of opening cursor much time to record the line and your code in the treatment of the sliders, exceptions.

So it would be better to consider all the data at once and even within a single processing loop.

Kind regards

Prashant da Silva

Tags: Database

Similar Questions

  • UNION ALL GROUP THEN SQL - is a better way

    Hi gurus of SQL,.

    Just try my luck to see if there is a better way to write the following SQL code. I don't know if the UNION ALL + GROUP BY is the best way. Is it better to use a FULL OUTER JOIN instead?

    Thanks for your time.

    See you soon
    Ligon
    SELECT 
       x.task_id,
       x.task_name,
       max(x.actual_effort)  actual_effort,
       max(x.date_completed) date_completed,
       max(x.status)         status
     FROM
     (         
          SELECT 
            t.task_id, 
            t.task_name,
            NULL actual_effort,
            NULL date_completed,
            NULL status
          FROM tt_tbl_tasks t, tt_tbl_emps e, tt_tbl_references r
          WHERE /*t.task_status = 'Y'
          AND*/ t.task_start_dt <= menu_util.get_date('15/02/2010',menu_util.df)
          AND NVL(t.task_end_dt,SYSDATE+9999) >= menu_util.get_date('15/02/2010',menu_util.df)
          AND e.emp_id = 'MEARS_MP'
          AND t.task_id = e.task_id
          AND r.ref_type = 'FREQUENCY'
          AND t.task_frequency = r.ref_id
          AND is_event_ready
              (p_start_dt => t.task_start_dt,
               p_end_dt   => t.task_end_dt,
               p_check_dt => menu_util.get_date('15/02/2010',menu_util.df),
               p_freq     => to_number(r.ref_name)) = 'Y'
         
         UNION ALL
         
         SELECT 
            t.task_id,
            t.task_name,
            ev.actual_effort,
            ev.date_completed,
            ev.status
          FROM tt_tbl_tasks t, tt_tbl_emps e, tt_tbl_events ev
          WHERE ev.date_completed = menu_util.get_date('15/02/2010',menu_util.df)
          AND t.task_id = ev.task_id
          AND e.emp_id = 'MEARS_MP'
          AND t.task_id = e.task_id
      )x
      GROUP BY  x.task_id,x.task_name
    ... and here's the plan
    Plan
    SELECT STATEMENT  ALL_ROWSCost: 11  Bytes: 178  Cardinality: 2                                          
         18 HASH GROUP BY  Cost: 11  Bytes: 178  Cardinality: 2                                     
              17 VIEW TTDB. Cost: 10  Bytes: 178  Cardinality: 2                                
                   16 UNION-ALL                           
                        8 NESTED LOOPS                      
                             6 NESTED LOOPS  Cost: 5  Bytes: 88  Cardinality: 1                 
                                  4 NESTED LOOPS  Cost: 4  Bytes: 65  Cardinality: 1            
                                       2 TABLE ACCESS BY INDEX ROWID TABLE TTDB.TT_TBL_TASKS Cost: 4  Bytes: 52  Cardinality: 1       
                                            1 INDEX RANGE SCAN INDEX TTDB.TT_TBL_TASKS_IDX_START_DT Cost: 2  Cardinality: 5  
                                       3 INDEX UNIQUE SCAN INDEX (UNIQUE) TTDB.TT_TBL_EMPS_PK Cost: 0  Bytes: 13  Cardinality: 1       
                                  5 INDEX UNIQUE SCAN INDEX (UNIQUE) TTDB.TT_TBL_REFERENCES_PK Cost: 0  Cardinality: 1            
                             7 TABLE ACCESS BY INDEX ROWID TABLE TTDB.TT_TBL_REFERENCES Cost: 1  Bytes: 23  Cardinality: 1                 
                        15 NESTED LOOPS  Cost: 5  Bytes: 64  Cardinality: 1                      
                             13 NESTED LOOPS  Cost: 5  Bytes: 102  Cardinality: 2                 
                                  10 TABLE ACCESS BY INDEX ROWID TABLE TTDB.TT_TBL_EVENTS Cost: 3  Bytes: 36  Cardinality: 2            
                                       9 INDEX RANGE SCAN INDEX TTDB.TT_TBL_EVENTS_IDX_DT_COMPLETED Cost: 1  Cardinality: 2       
                                  12 TABLE ACCESS BY INDEX ROWID TABLE TTDB.TT_TBL_TASKS Cost: 1  Bytes: 33  Cardinality: 1            
                                       11 INDEX UNIQUE SCAN INDEX (UNIQUE) TTDB.TT_TBL_TASKS_PK Cost: 0  Cardinality: 1       
                             14 INDEX UNIQUE SCAN INDEX (UNIQUE) TTDB.TT_TBL_EMPS_PK Cost: 0  Bytes: 13  Cardinality: 1                 

    Something like that I guess.

    select t.Task_ID
          ,t.Task_Name
          ,p.Actual_Effort
          ,p.Date_Completed
          ,p.Status
    from
        (
          select
                  t.Task_ID   as Task_ID
                 ,t.Task_Name as Task_Name
          from
                  tt_tbl_Tasks      t
                 ,tt_tbl_Emps       e
                 ,tt_tbl_References r
          where
                  t.Task_Start_Dt                   <= Menu_Util.Get_Date('15/02/2010',Menu_Util.Df)
          and     nvl(t.Task_End_Dt,sysdate + 9999) >= Menu_Util.Get_Date('15/02/2010',Menu_Util.Df)
          and     e.Emp_ID                          = 'MEARS_MP'
          and     t.Task_ID                         = e.Task_ID
          and     r.Ref_Type                        = 'FREQUENCY'
          and     t.Task_Frequency                  = r.Ref_ID
          and     is_Event_Ready
                 (p_Start_Dt => t.Task_Start_Dt,
                  p_End_Dt   => t.Task_End_Dt,
                  p_Check_Dt => Menu_Util.Get_Date('15/02/2010',Menu_Util.Df),
                  p_Freq     => to_number(r.Ref_Name)) = 'Y'
        ) t
    left join
          (
            select Task_ID
                 ,Task_Name
                 ,Actual_Effort
                 ,Date_Completed
                 ,Status
            from
                (
                 select
                    t.Task_ID           as Task_ID
                   ,t.Task_Name         as Task_Name
                   ,ev.Actual_Effort    as Actual_Effort
                   ,ev.Date_Completed   as Date_Completed
                   ,ev.Status           as Status
                   ,row_number() over  (partition by t.Task_ID, t.Task_Name
                                        order by ev.Actual_Effort   desc
                                                ,ev.Date_Completed  desc
                                                ,ev.Status          desc) rn
                  from    tt_tbl_Tasks      t
                         ,tt_tbl_Emps       e
                         ,tt_tbl_Events     ev
                  where
                          ev.Date_Completed = Menu_Util.Get_Date('15/02/2010', Menu_Util.Df)
                  and     t.Task_ID         = ev.Task_ID
                  and     e.Emp_ID          = 'MEARS_MP'
                  and     t.Task_ID         = e.Task_ID
                )
            where rn = 1
          ) p
    on  t.Task_ID   = p.Task_ID
    and t.Task_Name = p.Task_Name 
    

    The join type and if you filter by null will determine what your require, then its up to you to experiment.

  • Version 4.0 beta of what happened to all my addons?

    Version 4.0 Beta 1, what happened to all my addons/toolbars?

    This has happened

    Each time Firefox opened

    is installed 4.0

    Firefox 4 is still in beta phase, and as a result, a lot of people addons use are not compatible with Firefox. In addition, Firefox 4 beta is installed, by default, to another folder, which also makes the separation between your Firefox 3 addons and addons of Firefox 4.
    Therefore, I recommend waiting for your addons to update and use Firefox 3 at the moment.

  • I created a shortcut icon to my favorites, I'm done with ALL the Favorites as separate icons on my desktop

    original title: destop icon problems, I created a shortcut icon to my favorites... I'm done with ALL the Favorites as separate icons on my desktop. I can't see even my previous icons or my screen saver picture... It is under the many many icons off my favorites folder. How can I get rid of them all at once rather than individualluy... which will be forever! @!!! ???

    I created a shortcut icon to my favorites... I'm done with ALL the Favorites as separate icons on my desktop. I can't see even my previous icons or my screen saver picture... It is under the many many icons off my favorites folder. How can I get rid of them all at once rather than individualluy... which will be forever! @!!! ???

    See if you can get out of this mess by doing a system restore. Choose the date until you have created this shortcut as you restore point.
    In case you need the "How to":

    Start button > Search box, typeSystem Restore > press enter > uac prompt > click on choose a different restore point > next > select dates as your restore point, until the click > next > finish
    To sit and wait. The machine restarts when it's done.

    For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • [8i] need help on query with a subquery/inline using UNION ALL view

    OK, first of all let's start with some background info:
    (1) I work in 8i
    (2) some samples for my problem (please excuse the additional columns of data not used to this problem; I already had the sample laying around tables):
    CREATE TABLE     vbom
    (
         part_nbr     char(25)     
    ,     bom_doc_nbr     char(25)     
    ,     bill_level     number          
    ,     comp_part_nbr     char(25)     
    ,     qty_per          number
    );
    --technically has primary and foreign keys, but whatever...
    --part_nbr is your top level (0) parent
    --comp_part_nbr is the specific child
    --bom_doc_nbr is the parent of the child (comp_part_nbr) and may be either part_nbr or a child of part_nbr that is also a parent
    
    INSERT INTO vbom
    VALUES ('SAMPLE-1','SAMPLE-1', 1,'SAMPLE-2',1);
    
    CREATE TABLE     rqmt
    (
         comp_part_nbr     char(25)     
    ,     prnt_part_nbr     char(25)
    ,     ord_nbr          char(10)     
    ,     sub_ord_nbr     char(3)
    ,     qty_reqd     number
    ,     qty_issued     number
    ,     date_reqd     date
    ,     rqmt_stat     char(2)
    ,     rqmt_type     char(2)
    );
    
    INSERT INTO rqmt
    VALUES ('SAMPLE-1','','S0000TEST1',001,30,0,TO_DATE('06/01/2010','mm/dd/yyyy'),'AL','ID');
    INSERT INTO rqmt
    VALUES ('SAMPLE-2','SAMPLE-1','0000054963',001,15,10,TO_DATE('04/01/2010','mm/dd/yyyy'),'CL','DD');
    INSERT INTO rqmt
    VALUES ('SAMPLE-2','SAMPLE-1','0000032562',001,5,5,TO_DATE('04/15/2010','mm/dd/yyyy'),'IS','DD');
    INSERT INTO rqmt
    VALUES ('SAMPLE-2','SAMPLE-1','0000022341',001,5,4,TO_DATE('04/20/2010','mm/dd/yyyy'),'SH','DD');
    INSERT INTO rqmt
    VALUES ('SAMPLE-2','SAMPLE-1','0000043469',001,10,0,TO_DATE('04/30/2010','mm/dd/yyyy'),'AL','DD');
    INSERT INTO rqmt
    VALUES ('SAMPLE-2','SAMPLE-1','0000071235',001,10,0,TO_DATE('05/01/2010','mm/dd/yyyy'),'OP','DD');
    INSERT INTO rqmt
    VALUES ('SAMPLE-2','SAMPLE-1','0000061224',001,5,0,TO_DATE('05/15/2010','mm/dd/yyyy'),'FP','DD');
    INSERT INTO rqmt
    VALUES ('SAMPLE-2','SAMPLE-1','0000033294',001,5,0,TO_DATE('05/25/2010','mm/dd/yyyy'),'PL','DD');
    So, my first question was that I needed to find in the table RQMT who corresponded with everything on my VBOM have vbom.part_nbr table ' SAMPLE-1'. '. (Please note, in reality the VBOM table has thousands of rows of data, rather than just the 1 I have planned, some of them sharing the same vbom.part_nbr, others not). In addition to finding all RQMT data corresponding to the vbom.comp_part_nbr to vbom.part_nbr (where vbom.comp_part_nbr = rqmt.comp_part_nbr), I also need to find RQMT data for vbom.part_nbr itself (then, records where vbom.part_nbr = rqmt.comp_part_nbr).

    To resolve this problem, I started with the following query:
    SELECT     v.bill_level          AS bill_lvl
    ,     v.comp_part_nbr          AS component
    ,     v.bom_doc_nbr          AS parent
    FROM     VBOM v
    WHERE     v.part_nbr     ='SAMPLE-1'
    UNION ALL
    SELECT     0               AS bill_lvl
    ,     'SAMPLE-1'          AS component
    ,     NULL               AS parent
    FROM DUAL
    It allows me to add a line to the top of the page parent (vbom.part_nbr), which does not exist in vbom.
    My first question is, is UNION ALL of the best way to do it, or could I do a kind of instruction based on the line number box (or something) that would be better? (in this application, or in the final query)

    Then, I used the above query as a point of view online:
    SELECT     a.bill_lvl
    ,     a.component
    ,     a.parent
    ,     r.ord_nbr
    ,     r.sub_ord_nbr
    ,     r.qty_reqd
    FROM     (
         SELECT     v.bill_level          AS bill_lvl
         ,     v.comp_part_nbr          AS component
         ,     v.bom_doc_nbr          AS parent
         FROM     VBOM v
         WHERE     v.part_nbr     ='SAMPLE-1'
         UNION ALL
         SELECT     0               AS bill_lvl
         ,     'SAMPLE-1'          AS component
         ,     NULL               AS parent
         FROM DUAL
         ) a
    ,     RQMT r
    WHERE     a.component     = r.comp_part_nbr
    The problem here is that I have the same results (7 files) with the above query as I do with:
    SELECT     v.bill_level
    ,     v.comp_part_nbr
    ,     v.bom_doc_nbr
    ,     r.ord_nbr
    ,     r.sub_ord_nbr
    ,     r.qty_reqd
    FROM     VBOM v
    ,     RQMT r
    WHERE     v.comp_part_nbr     = r.comp_part_nbr
    AND     v.part_nbr     = 'SAMPLE-1'
    .. .it does not include RQMT recording for rqmt.comp_part_nbr = "SAMPLE-1'.

    To understand what was going on, I ran:
    SELECT     a.bill_lvl
    ,     a.component
    ,     a.parent
    FROM     (
         SELECT     v.bill_level          AS bill_lvl
         ,     v.comp_part_nbr          AS component
         ,     v.bom_doc_nbr          AS parent
         FROM     VBOM v
         WHERE     v.part_nbr     ='SAMPLE-1'
         UNION ALL
         SELECT     0               AS bill_lvl
         ,     'SAMPLE-1'          AS component
         ,     NULL               AS parent
         FROM DUAL
         ) a
    .. .and I get exactly this that I wait, 1 card for the SAMPLE-2 component and 1 plug for SAMPLE-1 (i.e. the recording I generated with the UNION ALL).

    Then I ran:
    SELECT     r.comp_part_nbr
    ,     r.ord_nbr
    ,     r.sub_ord_nbr
    ,     r.qty_reqd
    FROM     RQMT r
    WHERE     r.comp_part_nbr like 'SAMPLE-%'
    .. .and I get all 8 records, whose SAMPLE-1.

    So, it seems that the problem occurred when I join my opinion RQMT one online, although both separately seem to work very well.

    A point to note: all parts of parent and child may not be appointed in the same way as in my example. SAMPLE-1 could have children of the SAMPLE-2, abc123, 20735, for example.

    Any help on this would be appreciated, thanks!

    Hello

    Concerns of problem by comparing 8 literal characters ' SAMPLE-1' for the 25-character CHAR column that contains "SAMPLE 1".»
    17 spaces including the literal or use LPAD or CAST to 25 characters.
    For example:

    SELECT     a.bill_lvl
    ,     a.component
    ,     a.parent
    ,     r.ord_nbr
    ,     r.sub_ord_nbr
    ,     r.qty_reqd
    FROM     (
         SELECT     v.bill_level          AS bill_lvl
         ,     v.comp_part_nbr          AS component
         ,     v.bom_doc_nbr          AS parent
         FROM     VBOM v
         WHERE     v.part_nbr     ='SAMPLE-1'
         UNION ALL
         SELECT     0               AS bill_lvl
         ,     CAST ('SAMPLE-1' AS CHAR (25))               -- CAST added here
                                      AS component
         ,     NULL               AS parent
         FROM DUAL
         ) a
    ,     RQMT r
    WHERE     a.component     = r.comp_part_nbr
    ;
    

    Is there a reason why you use CHAR instead of VARCHAR2? (One reason other than "I can't change it now.", otherwise said.)

  • Is it possible to have the text be the opposite color of what's behind all this? Muse

    I use Adobe Muse.

    I am currently having the black text on a rectangle transition white to white text on a black rectangle. I hope to have just the color to be opposite of what is behind all this. For example, when you scroll to the bottom, black is shot like a curtain using Parallax scrolling, but I want to be white in front of the curtain and the black on the background when you scroll text.

    Screen Shot 2015-06-02 at 6.42.48 PM.png

    Screen Shot 2015-06-02 at 6.48.12 PM.png

    Blend modes are not part of the current CSS specification. They are developing and many browsers already come with at least partially, but this does not mean that they are safe to use. Anyway, given that the Muse only supports things officially standardized, you need to change the respective CSS rules and include background mix attributes and all after publication / including manual HTML manually. There is also jQuery stuff there that simulates by dynamically adjusting the colors, but naturally it would have the limitation of only operating on a 'box', that is to say a whole word or letter, not per pixel. For the time that it is better to look at other ways to do it. To using a background black uniform on the entire width of the page and make the white text to separate the menu seems simple enough...

    Mylenium

  • UNION and UNION ALL giving multiple result sets even if INTERSECT does not lines.

    Hello

    I have a set of two queries. I used the UNION to join the result set. When I used UNION ALL, I get a different result set.

    BT when I use INTERSECT, I m not getting all the lines.

    SO, which I guess is, as operation INTERSECT isn't Govind all the lines, then the UNION and UNION ALL of the result sets must be simliar.

    But I m getting different result sets.

    Please guide me.

    Thank you.

    Hello

    UNION returns separate lines; UNION ALL returns all rows that produce queries.

    INTERSECT has nothing to do with it.  You can have the lines in a single query.  For example

    Job SELECTION

    FROM scott.emp

    UNION - ALL THE

    SELECT 'FUBAR '.

    DOUBLE;

    In this example, there is no overlap between the 2 queries (INTERSECT would have 0 rows).

    UNION produces 6 lines, because the query at the top of the page produces 5 distinct lines (of 14 total ranks) and the background query 1.

    UNION ALL product lines 15: 14 of the request from top and 1 of the request from the lower part.

    I hope that answers your question.

    If not, post a test script (if necessary) and complete, including some UNION, UNION ALL queries INTERSECT.  Post of the CREATE TABLE and INSERT statements for all tables using those queries (with the exception of the commonly available rtables, such as those of the scott schema) and a specific question, such as "the UNION query all product...» I expect the UNION query to produce... because... but instead, it produces... Why is this?  It seems contractict... manual which says that... ».

  • UNION ALL in COLLECTION in BULK

    My code is like this:
    SELECT COL_NAME, COUNT BULK COLLECT INTO v_collections FROM
    (
    SELECT 'PROD_NAME' COL_NAME, COUNT(*) COUNT FROM TEST_TABLE
    WHERE LENGTH(PROD_NAME)>50  
    UNION ALL
    SELECT 'PROD_DESC' COL_NAME, COUNT(*) COUNT FROM TEST_TABLE
    WHERE PROD_DESC IS NULL
    .
    .
    .
    ..10 MORE UNION ALL
    );
    {code}
    
    --does it lead to one context switch or multiple one for each select in the union all
    --I do want to capture # of errors for each column 
    --although the code runs very fast, still I am worried that it may not be a good coding practice.
    --is there any better way to do this?
    --TEST_TABLE has 1 million records
    
    Thanks,
    RN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    >
    -causes change of context or more for each selection in the union all the
    >
    A single switch since the entire SQL (i.e. all queries combined set) is sent.
    >
    is there a better way to do it?
    >
    It depends on. What you do with the data you are interviewing?
    The best way is to use SQL instead of PL/SQL whenever possible. But since we do not know what everything you do has no way to help us.

  • Why Dev Guide says 'create a separate project for each workflow to ADF... '. »

    Hello

    We have a process BPM application that is having some human tasks. Form for each of the human tasks is similar. We would like to share some fragments of page or code between them and create unique web application to manage all human tasks for this application of BPM process. Then, I found the following in the document Oracle "Oracle SOA Suite 11 g Release 1 (11.1.1.4.0) Developer Guide":

    "If the composite SOA contains several human tasks, create a separate project for each ADF workflow associated with each human task."

    I wonder if we have to do and if so, what is the reason.

    Do you have any idea? Help, please.


    Thank you very much

    Helen

    Hi Helen
    1. I don't know the reason why they mentioned as separate project for each human task. NO, this is not necessary and we can have a single project of UI as MyTaskForms and have all JSPS in this same project for each human task.

    2. for our part, we have like 10 human tasks, while using the same payload. We have therefore 10 .task file. For the first file .task, we Auto generate project and gave the name of the project as OurAppTaskForms. Is the reason why as we did, for he adds all dependent libraries required, tag libs etc correctly. For all other .tasks files 9, we did NOT use auto generate. Instead we used standard New-> JSF human task and select only one task at a time and follow the steps. These steps are covered in the online documentation. At the end in our BPM application, we have just a UI project with all 10 screens.

    3. in ADDITION, all 10 screens have some common data. We put in a reusable JSF Fragment page. And associated with a managed Bean for this set and get the values of this fragment and also certain Actions for a few buttons in the Joint Strike Fighter. Then, we have included this JSF in every file of jsf taskform, uisng the tag include. We have added the include tag, somewhere in the upper part. If all the screens share common page fragment of jsf.

    4. we can refine the above things further. As per above, we have again JSF 10 screens for each one of the .tasks 10. Of course all these 10 jsf have same common jsf fragment. BUT instead of 10 screens individual jsf, we can have only ONE screen of Jsf also. For details, see the docs online. The hard part is, we don't have that one jsf, there may be a few tricks of bussiness, validatoin stuff to take care of in Manager ValidationCallback custom classes. Say for Task1, had to show some buttons, but NOT for Task2. So, we have to manage this logic. Also validation callback, we can always get each task, title also. So that we can get around this problem too. We are in the process of doing now. But first of all 3, we did it before and they work very well.

    My personal suggestion is to first go with jsf one fragment and include all duties jsp files. Any changes made to the common elements need only put in one place IE page fragment.

    Thank you
    Ravi Jegga

  • Select different columns using union all

    I'm trying to select all the records of two table

    Select A, B, C from table1
    Union of all the
    Select A, B, D, E, F from table2

    I get results A, B, C columns but not D, E, F.

    What should I do to get all the columns in the result. as A, B, C, D, E, F

    Thank you
    SK

    Hello

    That's what you asked for:

    select         Total_Customer_Qty,  NULL AS Total_Supplier_Qty,  Item_number,  Org,item_id  from table1;
    union all
    select NULL AS Total_Customer_Qty,          Total_Supplier_Qty,  Item_number,  Org,item_id  from table2;
    

    I hope that's what you want, too.
    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all tables and also post the results desired from these data.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.

  • My UNION ALL is not enough work - help!

    Hi gurus.

    I hope one of you fine pro can sort this for me...

    I have a script which is currently if there is an employee number to double but NOT if there is a double number of NOR - what code should I include?
          SELECT DISTINCT per.person_id, per.business_group_id, per.last_name,
                          per.start_date, per.date_of_birth, per.email_address,
                          LPAD(per.employee_number,8,'0') employee_number,
                          per.first_name,
                          per.marital_status, per.middle_names, per.nationality,
                          per.national_identifier, per.sex, per.title,
                          padd.address_id, padd.primary_flag, padd.address_line1,
                          padd.address_line2, padd.address_line3,
                          padd.town_or_city, padd.postal_code,
                          padd.telephone_number_1, paas.assignment_id,
                          paas.assignment_number, paas.object_version_number,
                          paas.effective_start_date, paas.effective_end_date,
                          paas.job_id, paas.position_id, paas.location_id,
                          paas.organization_id, paas.assignment_type,
                          paas.supervisor_id, paas.default_code_comb_id,
                          paas.set_of_books_id, paas.period_of_service_id
                     FROM per_all_people_f per,
                          per_all_assignments_f paas,
                          per_addresses padd
                   
                      WHERE padd.person_id = per.person_id
                      AND paas.person_id(+) = per.person_id
                          AND TRIM (LEADING '0' FROM per.employee_number) = TRIM (LEADING '0' FROM :p_emp_number)
                          AND per.national_identifier <> :p_ni_number 
                          
                          
                            UNION ALL
              
              
                SELECT DISTINCT per.person_id, per.business_group_id, per.last_name,
                          per.start_date, per.date_of_birth, per.email_address,
                         LPAD(per.employee_number,8,'0') employee_number,
                          per.first_name,
                          per.marital_status, per.middle_names, per.nationality,
                          per.national_identifier, per.sex, per.title,
                          padd.address_id, padd.primary_flag, padd.address_line1,
                          padd.address_line2, padd.address_line3,
                          padd.town_or_city, padd.postal_code,
                          padd.telephone_number_1, paas.assignment_id,
                          paas.assignment_number, paas.object_version_number,
                          paas.effective_start_date, paas.effective_end_date,
                          paas.job_id, paas.position_id, paas.location_id,
                          paas.organization_id, paas.assignment_type,
                          paas.supervisor_id, paas.default_code_comb_id,
                          paas.set_of_books_id, paas.period_of_service_id
                     FROM per_all_people_f per,
                          per_all_assignments_f paas,
                          per_addresses padd
                   
                      WHERE padd.person_id = per.person_id
                      AND paas.person_id(+) = per.person_id
                          AND TRIM (LEADING '0' FROM per.employee_number) = TRIM (LEADING '0' FROM :p_emp_number)
                          AND per.national_identifier = :p_ni_number; 
    Thank you very much...

    Steven

    Hello

    JackyWhite wrote:
    .. the first section is scheduled to end with

     AND per.national_identifier <> p_ni_number 
    

    but for some reason any of this is not displayed on the screen.

    Do you mean it is supposed to be an inequality raise it after per.national_identifier and before p_ni_number ?
    This site do not display the operator <>, even inside code tags.
    When posting on this site, always use the other inequality operator! =. There is no difference in performance.
    >

    Its mainly because I need to put a RC in the script but could not because of the outer join if it was to be a UNION all operation This is why the half you get first a <> p_ni_number and the second you get an AND per.national_identifier = p_ni_number;...

    The restriction OR applies only to outer join conditions. In other words, you can not say

    WHERE   paas.person_id (+) = per.per.person_id
    OR      pass.fubar (+)     = per.fubar
    

    (You can do this by using the notation ANSI; just one of the many reasons we syntax ANSII).
    However, you can use OR other conditions; for example:

    WHERE   paas.person_id (+) = per.per.person_id
    AND     (   per.national_identifier != p_ni_number
            OR  per.national_identifier  = p_ni_number
            )
    

    which seems to be what you're trying to do. Moreover, the WHERE clause above is equivalent to

    WHERE   paas.person_id (+) = per.per.person_id
    AND     per.national_identifier IS NOT NULL
    AND     p_ni_number             IS NOT NULL
    

    Whenever you need help, post a few examples of data (CREATE TABLE and INSERT statements), and desired results based on these data to the format.
    Simplify as much as possible. For example, your actual query may involve 35 columns, but display only the columns used in the conditions, as well as maybe one more column per table. After that you have a solution for the simplest prioblem, adding that the other columns will be triviial.

  • something faster than the UNION ALL?

    Hello

    I have two tables, with 20% and 80% of a total Group of data.
    The next time you press data, I need to have one top index so that the total dataset can be scanned.

    The result of this update is an update of the two tables.

    Here's my question (pls ignore syntax errors):

    I could do something like:

    create new_table
    As select * from t1
    UNION ALL
    Select * from t2

    change new_table add a primary key (acc_no)

    and then
    drop table t1
    drop table t2

    then the next cycle of treatment happens that, using new_table and a new set of entry, the t1 and t2 are filled (updates/inserts; and non-modifications/old)

    Then, new new_table is generated by t1 and t2... with a new index.

    This table is used again to read the next incoming batch of data, new filling t1 and t2...
    etc etc.

    actually, we have table t1 to send out of the database (flatfile). Then maybe we can do something faster as well. Maybe we don't need two tables at all?


    QUESTION 1:
    rather than generate a new table OF T2 T1 UNION ALL, I rather have the new table 'to be' the two tables? In this case, I just need to build the index on the table. Of course, t1 and t2 would disappear, but I have to drop them in any case for the next set of data.

    QUESTION 2:
    a little more advanced, is this table that combines all the results in the next 'as-is', must in fact be a table? I just need the appropriate fields (hm, in fact - all - fields) so I can make a new t1 and t2; There may be some smarter way to do it, without actually creating a new table t1 and t2 all the time...

    a big thank you in advance, your help is greatly appreciated

    Arne

    Rustydud wrote:
    Hi Dave Hemming.

    two thoughts on this approach,
    first of all I have not needed to keep the info on what were t1 and t2; they can be recessed. Rather the other way around, t1 + t2 will be "reborn" in the next run, based on the staging of new data and the "union all" table of the previous run (t1 + t2). then you see IS t1 + t2, after which t1/t2 would become useless.

    No, I do not say that you will not regenerate the tables t1 and t2. There is only one only true table new_table. Everything you would do the table t1 that you do view t1 and it is done as if by magic to the underlying new_table. Even with t2 - there is an opinion, not a table.

    The other approach is a view new_table which is a union of the tables t1 and t2, but then how do you index?

  • How can I create a separate address book? I'm not on a mailing list but an address book where addresses are not mixed with my usual address b

    How can I create a separate address book? I'm not on a mailing list but an address book where addresses are not mixed with my address book regularly. I already have three created for me by Thunderbird address books. Add all new addresses to one of those, I'm not afraid to remove the other address books, because some of their addresses are not repeated in my address book "main". So if I delete all the names in one of the existing books, I need to create a blank book that will not mix the addresses with those of an another address book. HOW CAN I CREATE AN ADDRESS BOOK EMPTY? I want to be able to create multiple mailing LISTS using the addresses in this new book, I will eventually have an address book special with a variety of mailing lists, that I can use as I want to.

    In the address book, file | New | Address book.

    No menu showing "file"? F10 or ALT.

  • Camileo S10 - what kind of file should create?

    Hey all - really hoping someone can help me here. What kind of file does create the S10 and what format must I convert to in order to be able to change using something like Vegas? Total quality 1080 p files are unplayable on my computer and all the sites I want to try to educate myself, I just end up getting lost in a sea of endless variants on 3rd party converters and file extensions I have NO idea what they are.

    Sorry if I seem a little newbish! I just want to get this camera, and in my program files and I will slowly mad trying to figure out how. Big thank you in advance to anyone who can help me!

    -Paul

    Hello

    As far as I know that records of camcorder films to video format .mov and you can use Quicktime player to play videos

    You can also use a free tool called SUPER that would transform this file format in other formats

    Welcome them

  • When you perform a system recovery - it removes all partitions created?

    Model number: HP Pavilion p6795
    Operating system: A Windows 7 Home Premium 64-bit, now Windows 8 Pro 64-bit

    I'm looking to do a system restore to return my system to the default settings. I usually share my records in particular, D: data separate operating system and program files.

    Could you please confirm it removes all partitions created on the main hard drive (for example, the D: drive) data?

    Thanks a lot for your help.

    Hello

    Yes, remember the day you bought the unit it will be taken back to this parameter.

Maybe you are looking for