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.

Tags: Database

Similar Questions

  • Collect in bulk does not print the results in the table

    Then the PL/SQL block below do not load and print whatever it is:

    -Database 11 g:
    declare
    Type (vr_Rec) is rendered
    DESCRIPTION VARCHAR2 (100)
    QTDE NUMBER (2));
    Type vt_Rec index vr_Rec table of Pls_Integer;
    va_rec vt_Rec;

    vc_Cursor SYS_REFCURSOR;

    Start
    Vc_Cursor open for 'SELECT "x" DESCRIPTION, 1 QTDE FROM DUAL UNION ALL' |
    "SELECT the"y"DESCRIPTION, 2 QTDE FROM DUAL;
    Loop
    Get the vc_Cursor collect in bulk va_rec limit 20000;
    When the output va_rec. Count = 0;
    End loop;
    Close Vc_Cursor;

    If va_rec > 0 Then Count.
    For / * everything * / i in va_rec. first... va_rec. last loop
    dbms_output.put_line (va_rec (i). DESCRIPTION | ' - ' || va_rec (i). QTDE);
    End loop;
    End If;
    end;

    lucitah wrote:
    Then the PL/SQL block below do not load and print whatever it is:

    Yes, this isn't. Look at the code. Each extraction replaces data read by the previous fetch. And since he finished when va_rec. Count = 0, we are left with empty va_rec. You need something like:

    declare
    Type vr_Rec Is Record (
    DESCRICAO VARCHAR2(100)
    , QTDE NUMBER(2) );
    Type vt_Rec Is table of vr_Rec Index By Pls_Integer;
    va_rec vt_Rec;
    
    vc_Cursor SYS_REFCURSOR;
    
    begin
    Open vc_Cursor For 'SELECT ''x'' DESCRICAO, 1 QTDE FROM DUAL UNION ALL '||
    'SELECT ''y'' DESCRICAO, 2 QTDE FROM DUAL';
    Loop
    Fetch vc_Cursor Bulk Collect Into va_rec Limit 20000;
    Exit When va_rec.Count = 0;
    For i In va_rec.First..va_rec.Last Loop
    dbms_output.put_line( va_rec(i).DESCRICAO || ' - ' || va_rec(i).QTDE );
    End Loop;
    End Loop;
    Close vc_Cursor;
    

    SY.

  • Collect in bulk

    Hi all

    I want to pick only 10 records at a time. It is extracted all 14 records why? I need only 10 records, if I had no please let me help.

    DECLARE

        CURSOR emp_cur IS

          SELECT empno,

                 ename ,

                 job

          FROM   emp;

        TYPE emp_no_type   IS TABLE OF emp. EmpNo % TYPE ;

        TYPE emp_name_type IS TABLE OF emp. Ename % TYPE ;

        TYPE job_name_type IS TABLE OF emp. job % TYPE ;

    emp_no_tab EMP_NO_TYPE

    emp_name_tab EMP_NAME_TYPE

    job_name_tab JOB_NAME_TYPE

        v_limit      PLS_INTEGER := 10;

    START

        OPEN emp_cur;

        LOOP

    -Get 10 rows at a time

            FETCH emp_cur bulk collect INTO emp_no_tab, emp_name_tab, job_name_tab

            limit

            v_limit ;

            EXIT WHEN emp_no_tab. County = 0;

            FOR i IN emp_no_tab. first .. emp_no_tab . last LOOP

                dbms_output . Put_line ('Emp Number: ' || Emp_no_tab (i) );

                dbms_output . Put_line ('Emp Name: ' || Emp_name_tab (i) );

                dbms_output . Put_line ('Emp Job: ' || Job_name_tab (i) );

            END LOOP;

        END LOOP;

        CLOSE emp_cur;

    END ;


    Thank U

    994122 wrote:

    Thank you..

    Ensure?

    What happens when the EMP table contains 24 ranks?

    Do not rely on the attributes of the cursor with bulk collect (PL/SQL practices: COLLECT in BULK)

    Just drag the outer loop, (because what you want to do, it's to combat by setting the limit only) and the exit condition:

    OPEN emp_cur;

    -LOOP

    -Go get 10 lines at a time

    Collect the FETCH emp_cur in bulk IN emp_no_tab, emp_name_tab, job_name_tab

    limit

    v_limit;

    -EXIT WHEN emp_no_tab.count = 0;

    I'm IN emp_no_tab.first... emp_no_tab. Last LOOP

    dbms_output. Put_line ('Emp number: ' |) Emp_no_tab (i));

    dbms_output. Put_line (' Name of Emp: ' |) Emp_name_tab (i));

    dbms_output. Put_line ('Emp Job: ' |) Job_name_tab (i));

    END LOOP;

    -END LOOP;

    CLOSE Emp_cur;

  • Question collect in bulk

    Dear all,

    I try to use bulk collect for one of my requirements. I defined a procedure and using bulk collect inside.

    The procedure is the compilation of the warnings.

    The error message is "PLS-00487: invalid reference to the variable 'I'".

    Here is the procedure I use.
    ----------------------------------
    CREATE OR REPLACE procedure APPS.XXX_MRP_PAY4 (RETCODE OUT VARCHAR2,
    ERRBUF OUT VARCHAR2
    -P_SERVICE_CALC_DATE IN DATE,
    -P_VARIABLE IN NUMBERS
    )
    is
    -L_VARIABLE NUMBER: = P_VARIABLE;
    cursor c1 is
    SELECT
    EMPLOYEE_NUMBER
    FULL_NAME
    OF XX_MRP_SALARY_BREAKUP SB,
    sit_date sd
    where = SB.employee_number sd.emp_num (+);

    TYPE MRP_RESULTS IS TABLE OF c1% ROWTYPE INDEX BY PLS_INTEGER;
    MRP MRP_RESULTS;

    CLOB L_TEXT;

    Start

    FND_FILE.put_line (FND_FILE.output, 'EMPLOYEE_NUMBER' |) CHR (9) | "FULL_NAME");
    -I'm looping C1
    OPEN c1;
    LOOP
    FETCH c1
    BULK COLLECT INTO MRP LIMIT 1500;
    WHEN THE MRP OUTPUT. COUNT = 0;
    because me in 1... MRP. COUNTY
    loop
    L_TEXT: = I.EMPLOYEE_NUMBER | Chr (9) | I.FULL_NAME;

    FND_FILE.put_line (FND_FILE.output, L_TEXT);
    end loop;
    END LOOP;
    CLOSE c1;
    end XXX_MRP_PAY4;

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

    You kindly could guide me on this plss

    Seems you placed a CURSOR for... LOOP in a COLLECTION in BULK.

    The variable 'i' used to be a record, but now it's a number.

    Suspect you want...

    l_text := mrp (i).employee_number || CHR (9) || mrp (i).full_name;
    
  • Ask. UNION ALL on two tables of dummy data

    I had a bit of SQL that joined a dynamic no cross table with another table of dummy data.

    WITH tbl_job_data AS (SELECT 'N' argument1, 'Y' argument2, NULL argument3, 'Y' argument4 FROM DUAL)
       , tbl_params   AS (SELECT 1 col_seq, 'From Project Number' col_prompt, NULL col_data, NULL col_attrib FROM DUAL UNION ALL
                          SELECT 2 col_seq, 'To Project Number'   col_prompt, NULL col_data, NULL col_attrib FROM DUAL UNION ALL
                          SELECT 3 col_seq, 'Through Date'        col_prompt, NULL col_data, NULL col_attrib FROM DUAL UNION ALL
                          SELECT 4 col_seq, 'Summarize Cost'      col_prompt, NULL col_data, NULL col_attrib FROM DUAL)
        SELECT  NULL AS col_seq
              , NULL AS col_prompt
              , d.col_data
              , d.col_attrib
        FROM    tbl_job_data
        UNPIVOT INCLUDE NULLS
                    (col_attrib
                FOR  col_data  IN (argument1
                                 , argument2
                                 , argument3
                                 , argument4)
                    ) d
        UNION ALL
        SELECT  tbl_params.col_seq
              , tbl_params.col_prompt
              , tbl_params.col_data
              , tbl_params.col_attrib
        FROM    tbl_params;
    
    
       COL_SEQ COL_PROMPT          COL_DATA  COL_ATTRIB
    ---------- ------------------- --------- ----------
                                   ARGUMENT1 N       
                                   ARGUMENT2 Y       
                                   ARGUMENT3         
                                   ARGUMENT4 Y       
             1 From Project Number                   
             2 To Project Number                     
             3 Through Date                          
             4 Summarize Cost                       
    
    8 rows selected.
    

    Sorry to be very naïve and ignorant, but is be possible that I can get the output in 4 lines like that, by a union on 2 statements:

       COL_SEQ COL_PROMPT          COL_DATA  COL_ATTRIB
    ---------- ------------------- --------- ----------
             1 From Project Number ARGUMENT1 N       
             2 To Project Number   ARGUMENT2 Y       
             3 Through Date        ARGUMENT3         
             4 Summarize Cost      ARGUMENT4 Y       
    

    I guess not, because the 2 tables don't really have a lot in common with them, but I thought I'd ask.

    Thank you

    Previously, contributed to these requests by Frank Kulash

    https://community.Oracle.com/thread/3810284 et https://community.Oracle.com/message/13361473

    WITH

    tbl_job_data AS

    (SELECT "n" argument1, argument2 'Y', NULL argument3, 'Y' argument4)

    OF THE DOUBLE

    ),

    tbl_params AS

    (SELECT 1 col_seq, number 'of the project"col_prompt, col_data, NULL, NULL col_attrib OF DOUBLE UNION ALL)

    SELECT 2 col_seq, col_prompt 'for the project number", NULL, col_data, NULL col_attrib OF DOUBLE UNION ALL

    SELECT 3 col_seq, col_prompt 'Date', NULL, col_data, NULL col_attrib OF DOUBLE UNION ALL

    SELECT 4 col_seq, col_prompt "summarizes the cost", NULL, col_data, NULL FROM DUAL col_attrib

    )

    Select y.*, x.*

    from (SELECT on col_seq (d.col_data control) row_number()

    NULL AS col_prompt

    d.col_data

    d.col_attrib

    OF tbl_job_data

    MUST INCLUDE NULL VALUES

    (col_attrib

    FOR col_data IN (argument1

    argument2

    argument3

    argument4)

    ) d

    ) x,.

    (SELECT tbl_params.col_seq

    tbl_params.col_prompt

    tbl_params.col_data

    tbl_params.col_attrib

    OF tbl_params

    ) y

    where x.col_seq = y.col_seq

    COL_SEQ COL_PROMPT COL_DATA COL_ATTRIB COL_SEQ COL_PROMPT COL_DATA COL_ATTRIB
    1 Project number - - 1 - ARGUMENT1 N
    2 For the project number - - 2 - ARGUMENT2 THERE
    3 By Date - - 3 - ARGUMENT3 -
    4 Summarize the cost - - 4 - ARGUMENT4 THERE

    Concerning

    Etbin

  • How to filter records in a UNION ALL query

    Hi all

    I have only one requirement to filter records in a query UNION all. If we do not all matching records to one of the union, all question them.

    create table test_1(n1 number,n2 number,n3 number)
    
    insert into test_1 values(1,2,3);
    insert into test_1 values(11,22,33);
    insert into test_1 values(55,66,77);
    
    Case-1 :
    
    SELECT N1,N2,N3
    FROM TEST_1
    WHERE N2=2
    UNION ALL
    SELECT N1,N2,N3
    FROM TEST_1
    WHERE N3=3
    
    Output is : This is desired output(so we are good)
    
    1,2,3
    1,2,3
    
    Case 2 :
    
    SELECT N1,N2,N3
    FROM TEST_1
    WHERE N2=22
    UNION ALL
    SELECT N1,N2,N3
    FROM TEST_1
    WHERE N3=44
    
    Output : (Here is the problem: If we don't have matching records for anyone union all query we don't want any records)
    
    Output is coming : 11,22,33
    
    Out put : No Records (We want this output.)
    

    I hope I have given the clear example of my requirement.

    Thank you.

    with

    test_1 as

    (select 1 n1, n2 2, n3 3 of all the double union)

    Select 11,22,33 from all the double union

    Select double 55,66,77

    )

    Select the n1, n2, n3

    from (select n1, n2, n3

    of test_1

    where n2 =: n2

    Union of all the

    Select the n1, n2, n3

    of test_1

    where = n3: n3

    )

    where exists (select null from test_1 where n2 =: n2)

    and it exists (select null from test_1 where = n3: n3)

    Concerning

    Etbin

  • Why UNION ALL allows no column names only when a literal is used and there is at least 3 parts of the query?

    An artificial union all:

    SQL> SELECT Dummy FROM Dual ORDER BY Dummy;
    
    D
    -
    X
    
    SQL> SELECT Dummy FROM Dual UNION ALL SELECT Dummy FROM Dual ORDER BY Dummy;
    
    D
    -
    X
    X
    
    SQL> SELECT Dummy FROM Dual UNION ALL SELECT Dummy FROM Dual UNION ALL SELECT Dummy FROM Dual ORDER BY Dummy;
    
    D
    -
    X
    X
    X
    
    
    

    It literally changes it:

    SQL> SELECT NULL A FROM Dual ORDER BY A;
    
    A
    -
    
    
    SQL> SELECT NULL A FROM Dual UNION ALL SELECT NULL FROM Dual ORDER BY A;
    
    A
    -
    
    
    
    SQL> SELECT NULL A FROM Dual UNION ALL SELECT NULL FROM Dual UNION ALL SELECT NULL FROM Dual ORDER BY A;
    SELECT NULL A FROM Dual UNION ALL SELECT NULL FROM Dual UNION ALL SELECT NULL FROM Dual ORDER BY A
                                                                                                     *
    ERROR at line 1:
    ORA-00904: "A": invalid identifier
    
    
    SQL> SELECT NULL A FROM Dual UNION ALL SELECT NULL FROM Dual UNION ALL SELECT NULL FROM Dual ORDER BY 1;
    
    A
    -
    
    
    
    
    

    Why 3 is the magic number?

    My friend, this is what I would call a "bug".

    However, my opinion doesn't matter, because I do not work for Oracle

    You opened a SR with Oracle?

  • Union all with addistional field

    Hello

    Maybe this is a stupid question.

    I have two tables with 22 columns.

    Another table with 23 columns

    I want to combine these two tables using union all.

    In the first picture, I want back "NA" as the last field.

    In the second table, last column is varchar2.

    Instead of every column one by one and if I use select * in two queries and add "NA" to one?

    I want the union two queries can order and use it with the clause to retrieve values based on conditions somany.

    So I have to specify the names of column three times.

    I use oracle 10g

    Hello Krishna,

    Try

    select t1.*, 'NA' as  from table1 t1
    union
    select t2.* from table2 t2;
    

    concerning

    Kay

  • Please help me with the Alternative of queries to replace the UNION ALL for two queries

    Hi all

    I have the query to retrieve assets employees salary count and in so far as below:

    Select ename, emp_no, sum (sal_till_2010), sum (sal_till_2014) of

    (select emp_no, ename, salary as sal_till_2010, 0 as sal_till_2014 of employee e1

    where effective_date < = 1 January 2010 ' and not exists (select 1 from e2 employee_deletion where e2.emp_no = e1.emp_no and e2.deletion_date < = January 1, 2010 "")

    UNION ALL

    Select ename, emp_no, 0 as sal_till_2010, salary as employee e1 sal_till_2014 - here is a dummy 0 salary until 2010 for the union of all the

    where effective_date < = 1 January 2014 "and not exists (select 1 from e2 employee_deletion where e2.emp_no = e1.emp_no and e2.deletion_date < = 1 January 2014") "

    Group of emp_no, ename;

    In this query, I get the total salary until 2010 and until 2014 in the employee table, dates are dynamically passed to the procedure, and this can change.

    But assume the date above and let me know the alternative of queries to improve performance because I use Union ALL and read the same table twice in the above query.

    Advice me with request to read the table once to fetch the same data as the above query.

    Thanks in advance.


    Hello

    Thanks for the display of the data of the sample; It's very useful!

    I think OP wants something like this:

    WITH cutoff_dates AS

    (

    SELECT TO_DATE (January 1, 2010 ', ' DD/MM/YYYY') AS cutoff_date, 2010 UNDER the label OF dual UNION ALL

    SELECT TO_DATE (1 January 2014 ', "DD/MM/YYYY"), double 2014

    )

    SELECT e.emp_no, e.ename

    , NVL (SUM (CASE WHEN c.label = 2010 THEN e.salary END), 0) AS sal_till_2010

    , NVL (SUM (CASE WHEN c.label = 2014 THEN e.salary END), 0) AS sal_till_2014

    E employee

    JOIN cutoff_dates c ON e.effective_date<=>

    WHERE DOES NOT EXIST)

    SELECT 1

    Of employee_deletion ed

    WHERE ed.emp_no = e.emp_no

    AND ed.deletion_date<=>

    )

    E.emp_no GROUP, e.ename

    ORDER BY e.emp_no

    ;

    Output of your sample data:

    EMP_NO ENAME SAL_TILL_2010 SAL_TILL_2014

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

    1 Mickey 450 0

    2 Donald 750 0

  • 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

  • LR mobile is not synchronize all my collections

    Lightroom is not syncing all the collections that have the sync mode. What is strange is that throughout the time that they have been synchronized and now the collection is here and no pictures in them. I even made new collections and moved the pictures in them and they either sync. I just reinstalled the app hoping it would work, but the collections are still empty. This affects only some collections. other collections appear fine and photos I add appear them immediately. any thoughts on what I can do?

    Hi willowtreestudio\

    Can you find the Collections you synchronize here Adobe Photoshop Lightroom (log in with your Adobe ID)

    In addition,

    That you initially imported these photos from your mobile phone or computer?

    Could you make sure missing images in the Collections are actually not missing on the Lightroom Catalog(on your Computer).

    Lack of photos will show you "!" sign on the top right of the thumbnail image.

    If so Adobe Photoshop Lightroom help | Locate missing photos

    Another way to check all the missing images in your catalog:-in the library Module > library (from the menu bar) > 'find all missing Photos.

    Also what version of Lightroom and what operating system your computer have?

    Concerning

    ~ Assani

  • Upgrade to v6 LR - lack of all THE collections (regular and smart)

    Had a computer crash, reinstalled CC (had to Lr 6 CC).
    Now, after 7 months of work upgrading is LITERALLY since each collection, we've created is now gone.


    Is it possible to find and export a catalog Lr 5 collections in Lr CC?

    NOTE: We are sports photographers and have more 140 000 images that have been sorted by team, player, sport and activity in different collections. All of these collections have been vital to our ability to sell images to customers... and some clients NOW expect their images.

    It will take weeks or even months to recreate all the collections again.

    Well... thank you all to check the catalog that I gave you.

    I went through and looked at the structures of directories on disks and backup drives use.
    Back up important files, folders, catalogues...
    Then ran 5.7.1 and CC
    By report...

    It looks like to---> I<--- was="" the="">

    There was a double set of folders a level to the top of the catalog of work
    D:/images/2015Sports (double)

    I'm not entirely sure why they are there in /Pictures/ because the backups are in the below sub directory structure and I put all working catalog directories in 'Lightroom' is a unique place for backup/archiving).

    D:/pictures/Lightroom/2015Sports (location of the catalog of work)

    In most cases, I want to say that I really care... but it seems in this case that I was not.
    Thanks to you all! (it seems that the case of the missing collections has been resolved... and that is the collector who did in the office). :-\

  • 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... ».

  • Concat Union all 3 rows

    Hi all

    Please I need help with th following question:

    WITH some_data LIKE)

    SELECT "CNDMNL75P65L736C" FC, "cp" cr, 0 as I1, 1 as I2, I3 OF double 0

    UNION ALL

    SELECT "PNZGCM74M24L736C", "cp" cr, 5, 0, 0 DOUBLE

    UNION ALL

    SELECT "," cp, '1', 675,0, 0 DOUBLE cr

    UNION ALL

    SELECT ", '027113850273' cp," cr, 0, 32, double 0

    UNION ALL

    SELECT ", '12298850273' cp," cr, 2, 0, 0 DOUBLE

    UNION ALL

    SELECT ", '35798850273' cp," cr, 0, 12, double 0

    UNION ALL

    SELECT ", '627771888273' cp," cr, 10, 2, 0 DOUBLE

    UNION ALL

    SELECT "XDZGCM74M22L736C", "cp" cr, 15, 0, 10 DOUBLE

    )

    Select * from some_data;

    FCCPCRI1 I2 I3
    CNDMNL75P65L736C0 1 0
    PNZGCM74M24L736C5 0 0
    1675 0 0
    0271138502730 32 0
    122988502732 0 0
    357988502730 12 0
    62777188827310 2 0
    XDZGCM74M22L736C15 0 10

    How can I get a something as; (Only) one record for every 3 rows, like this

    CNDMNL75P65L736C            0    1    0PNZGCM74M24L736C            5    0    0        1    675    0    0 (first 3 rows)
         027113850273        0    32  0    12298850273        2    0    0    35798850273        0    12    0      (next 3 rows, ) 
         627771888273        10    2   0 XDZGCM74M22L736C            15    0    10                         (and so on ) 
    

    Thanks in advance

    For the 11g version:

    WITH some_data AS (
      SELECT 'CNDMNL75P65L736C' cf,'' cp ,'' cr, 0 as I1, 1 as I2, 0 as I3 FROM dual
      UNION ALL
      SELECT 'PNZGCM74M24L736C' ,'' cp ,'' cr, 5, 0, 0 FROM dual
      UNION ALL
      SELECT '' , '' cp ,'1' cr, 675,0, 0 FROM dual
      UNION ALL
      SELECT '' , '027113850273' cp ,'' cr, 0 ,32, 0 FROM dual
      UNION ALL
      SELECT '' , '12298850273' cp ,'' cr, 2, 0 ,0 FROM dual
      UNION ALL
      SELECT '' , '35798850273' cp ,'' cr, 0, 12 ,0 FROM dual
      UNION ALL
      SELECT '' , '627771888273' cp ,'' cr, 10, 2 ,0 FROM dual
      UNION ALL
      SELECT 'XDZGCM74M22L736C' ,'' cp ,'' cr, 15, 0, 10 FROM dual
    )
    select * from (
    select a.*, mod(rownum-1,3)+1 rn, ceil(rownum/3) grp from some_data a
    )
    pivot(max(cf) cf, max(cp) cp, max(cr) cr, max(i1) i1, max(i2) i2, max(i3) i3
    for rn in (1 a,2 b,3 c));
    
    GRP A_CF A_CP A_CR A_I1 A_I2 A_I3 B_CF B_CP B_CR B_I1 B_I2 B_I3 C_CF C_CP C_CR C_I1 C_I2 C_I3
    1 CNDMNL75P65L736C 0 1 0 PNZGCM74M24L736C 5 0 0 1 675 0 0
    2 027113850273 0 32 0 12298850273 2 0 0 35798850273 0 12 0
    3 627771888273 10 2 0 XDZGCM74M22L736C 15 0 10

    For the 12 c version:

    WITH some_data AS (
      SELECT 'CNDMNL75P65L736C' cf,'' cp ,'' cr, 0 as I1, 1 as I2, 0 as I3 FROM dual
      UNION ALL
      SELECT 'PNZGCM74M24L736C' ,'' cp ,'' cr, 5, 0, 0 FROM dual
      UNION ALL
      SELECT '' , '' cp ,'1' cr, 675,0, 0 FROM dual
      UNION ALL
      SELECT '' , '027113850273' cp ,'' cr, 0 ,32, 0 FROM dual
      UNION ALL
      SELECT '' , '12298850273' cp ,'' cr, 2, 0 ,0 FROM dual
      UNION ALL
      SELECT '' , '35798850273' cp ,'' cr, 0, 12 ,0 FROM dual
      UNION ALL
      SELECT '' , '627771888273' cp ,'' cr, 10, 2 ,0 FROM dual
      UNION ALL
      SELECT 'XDZGCM74M22L736C' ,'' cp ,'' cr, 15, 0, 10 FROM dual
    )
    select * from some_data
    match_recognize(
      measures a.cf acf, a.cp acp, a.cr acr, a.i1 ai1, a.i2 ai2, a.i3 ai3,
               b.cf bcf, b.cp bcp, b.cr bcr, b.i1 bi1, b.i2 bi2, b.i3 bi3,
               c.cf ccf, c.cp ccp, c.cr ccr, c.i1 ci1, c.i2 ci2, c.i3 ci3
      pattern (a b{0,1} c{0,1})
      define a as 1=1, b as 1=1, c as 1=1
    );
    
    ACF ACP ACR AI1 AI2 AI3 BCF BCP BCR BI1 BI2 BI3 CCF CCP CCR CI1 CI2 CI3
    CNDMNL75P65L736C 0 1 0 PNZGCM74M24L736C 5 0 0 1 675 0 0
    027113850273 0 32 0 12298850273 2 0 0 35798850273 0 12 0
    627771888273 10 2 0 XDZGCM74M22L736C 15 0 10
  • I bought a new computer, installed LR5 and import photos from a remote hard drive. Photos is finer, but all my Collections disappeared.  Is there a way to retrieve my Collections?

    I bought a new computer, installed LR5 and import photos from a remote hard drive. Photos is finer, but all my Collections disappeared.  Is there a way to retrieve my Collections?

    The Collections are stored in the LR catalog. If you had previously copied to your catalog on the other computer to the new all your collections would have been there.

    Now that you have the images on the new computer, 'IF', they were placed in the same folder structure (IE even the folder names and locations) then copy through the original catalogue "should" include your collections. If they are in the names of different folder or on a different drive letter or name of the player, then you might be able to use the feature to locate Images to find them.

Maybe you are looking for

  • How to remove username choices that appear when you sign up

    When I connect my e-mail the drop down for the user name has old data I want to delete but does not know how to do

  • When Apple will repair the IOS 9.2 to sync with the bluetooth in my car.

    I had my vehicle in Service several times because my Iphone 6s does not synchronize with the Bluetooth in the car.  Engineers contacted GM Apple and informed there is a problem with the sync Apple products now that Apple updated to IOS 9.2.  I'm sure

  • Unable to play Baldurs gate

    Original title: programs Application Applications App Apps game games Legacy compatibility obscuring black window. BALDURS Gate enhanced edition steam loads and screens are normal and responsive until the correct game starts at Candlekeepwhen between

  • Video support HP Envy 17 Notetebook computer Touchsmart m7-j120dx

    I have the laptop above. It is equipped with an Intel HD 4600 graphics card. Question: How many monitors in addition to the laptop screen the map will allow to connect? It grows 2 additional monitors via a docking station, but they are both rated as

  • BlackBerry 8120 smartphones turns off

    I hope someone can help me. I confess to being a complete fool when it comes to technology, but I love my BB and have not had any problem since I got it in the month of April, but for the last week, she was driving me around the bend. I get a steady