How do the mulitple itemset column union with other tables

Hello

I have the following table, called set as below,

A
--------------------------
1; 10; 2; 3; 4; 5; 7; 8
10; 2; 3; 4; 5; 8; 9
10; 2; 3; 4; 8; 9

and another table called temp as below,

B
-------------------
1
2
6

and need to find the union of these 2 tables as below,

A---------------------| B | A Union B
-------------------------------------------------------------------
1; 10; 2; 3; 4; 5; 7; 8. 1 | ; 1; 10; 2; 3; 4; 5; 7; 8
1; 10; 2; 3; 4; 5; 7; 8. 2 | ; 1; 10; 2; 3; 4; 5; 7; 8
1; 10; 2; 3; 4; 5; 7; 8. 6 | ; 1; 10; 2; 3; 4; 5; 7; 8; 6

10; 2; 3; 4; 5; 8; 9. 1 | ; 10; 2; 3; 4; 5; 8; 9; 1
10; 2; 3; 4; 5; 8; 9. 2 | ; 10; 2; 3; 4; 5; 8; 9
10; 2; 3; 4; 5; 8; 9. 6 | ; 10; 2; 3; 4; 5; 8; 9; 6

10; 2; 3; 4; 8; 9. 1 | ; 10; 2; 3; 4; 8; 9; 1
10; 2; 3; 4; 8; 9. 2 | ; 10; 2; 3; 4; 8; 9
10; 2; 3; 4; 8; 9. 6 | ; 10; 2; 3; 4; 8; 9; 6



any help please,.

Published by: user11309581 on June 26, 2011 22:43

Published by: user11309581 on June 26, 2011 22:47
with a as (
           select ';1;10;2;3;4;5;7;8' str from dual union all
           select ';10;2;3;4;5;8;9' from dual union all
           select ';10;2;3;4;8;9' from dual
          ),
     b as (
           select '1' str from dual union all
           select '2' from dual union all
           select '6' from dual
          )
-- end of on-the-fly data sample
select  a.str,
        b.str,
        case
          when a.str || ';' like '%;' || b.str || ';%' then a.str
          else a.str || ';' || b.str
        end combined_str
  from  a,
        b
/

STR               S COMBINED_STR
----------------- - -------------------
;1;10;2;3;4;5;7;8 1 ;1;10;2;3;4;5;7;8
;1;10;2;3;4;5;7;8 2 ;1;10;2;3;4;5;7;8
;1;10;2;3;4;5;7;8 6 ;1;10;2;3;4;5;7;8;6
;10;2;3;4;5;8;9   1 ;10;2;3;4;5;8;9;1
;10;2;3;4;5;8;9   2 ;10;2;3;4;5;8;9
;10;2;3;4;5;8;9   6 ;10;2;3;4;5;8;9;6
;10;2;3;4;8;9     1 ;10;2;3;4;8;9;1
;10;2;3;4;8;9     2 ;10;2;3;4;8;9
;10;2;3;4;8;9     6 ;10;2;3;4;8;9;6

9 rows selected.

SQL>  

SY.

Tags: Database

Similar Questions

  • How to count the number of columns in an oracle table using sql

    How to count the number of columns in an oracle table using sql

    You must put the name of the table in capital letters

    As

    SELECT COUNT(1)
      FROM user_tab_columns
    WHERE table_name = 'EMP';
    
    or
    
    SELECT COUNT(1)
      FROM user_tab_columns
    WHERE table_name = UPPER('Emp');
    

    Concerning
    Arun

  • Using an IP191 monitor, have random horizontal stripes on the screen - have no problems with other browsers. also no problem with FF on the other PCs on the family

    Using an IP191 monitor, have random horizontal stripes on the screen - have no problems with other browsers. also no problem with FF on the other PCs on the family.

    These "streaks" seem to be the domain of the high frequency analysis; they can be eliminated by scrolling upwards or downwards.

    Hello, maybe it's a problem with hardware acceleration - try updating your graphic driver, or in case this does not solve the problem, or there is no new version available at the time, disable hardware acceleration in the firefox menu

    > options > advanced > General.

  • Apple Watch heart rate monitor, the signal can be shared with other devices such as the Garmin Edge 520?

    Apple Watch heart rate monitor, the signal can be shared with other devices such as the Garmin Edge 520?

    Hello

    No, that it is not currently possible.

  • FDQM write back to the EBS with other tables as GL

    Hello

    Please, I need a confirmation on FDQM: if it is possible to rewrite data from Hyperion Planning (Essbase) in EBS with other tables that GL using standard features FDQM (tables of EBS EBS sourcing purchases tables etc.).
    FDQM ERPI-write is limited to the EBS GL.

    Or write in EBS, I use ODI.

    I thank you and appreciate your input!
    Robert

    Hello

    Certainly, you can write additional scripts to do the job you are looking for. Unfortunately the only "out of the box solution" is mentioned above.

    Thank you

  • Functions Pipeline Table with other tables using

    I'm on DB 11.2.0.2 and used sparingly in pipeline table functions, but plans to arrays for a project that has a pretty big (many lines). In my tests, selecting from the table in pipeline perform well enough (if it's directly from the table pipleined or the view from above, I have created). Where I start to see some degregation when I try to join the tabe in pipeline discovered at other tables and add where conditions.

    Download

    SELECT A.empno, A.empname, A.job, B.sal

    OF EMP_VIEW A, B OF THE EMP

    WHERE A.empno = B.empno AND

    B.Mgr = '7839'

    I've seen articles and blogs that mention this as a matter of cardinality and offer some undocumented methods to try to fight.

    Can someone please give me some tips or tricks on this. Thank you!

    I created a simple example using the emp table below to help illustrate what I'm doing.

    DROP TYPE EMP_TYPE;

    DROP TYPE EMP_SEQ;

    CREATE OR REPLACE TYPE EMP_SEQ AS OBJECT

    (EMPNO NUMBER (10),)

    ENAME VARCHAR2 (100),

    VARCHAR2 (100)) WORK;

    /

    CREATE OR REPLACE TYPE EMP_TYPE AS TABLE EMP_SEQ;

    /

    FUNCTION to CREATE or REPLACE get_emp back EMP_TYPE PIPELINED AS

    BEGIN

    TO heart (SELECT IN

    EmpNo,

    Ename,

    job

    WCP

    )

    LOOP

    PIPE ROW (EMP_SEQ (cur.empno,

    cur. Ename,

    cur.job));

    END LOOP;

    RETURN;

    END get_emp;

    /

    create or REPLACE view EMP_VIEW select * from table (get_emp ());

    /

    SELECT A.empno, A.empname, A.job, B.sal

    OF EMP_VIEW A, B OF THE EMP

    WHERE A.empno = B.empno AND

    B.Mgr = '7839'

    bobmagan wrote:

    The ability to join would give me the most flexibility.

    Pipelines can be attached. But here is the PL/SQL code - no tables. And without index.

    Consider a view:

    create or replace view sales_personel in select * from emp where job_type = 'SALES '.

    And you use the view to determine the sellers in department 123:

    Select * from sales_personel where dept_id = 123

    Oracle considers that logically the next SQL statement like her can be pushed in the view:

    select * from emp where job_type = 'SALES' and dept_id = 123


    If the two columns in the filter are indexed for example, he may well decide to use a fusion of index to determine what EMP lines are dirty and department 123.

    Now consider the same exact scenario with a pipeline. The internal process of pipelines are opaque to the SQL engine. He can't say the internal code pipeline "Hey, don't give me employees service 123".

    He needs to run the pipeline. It must evaluate each channeled line and apply the "dept_id = 123" predicate. In essence, you must treat the complete pipeline as a table scan. And a slow that it take more than a simple disc lines when you perform the transformation of data too.

    So yes - you can use the predicates on the pipelines, can join them, use analytical SQL and so immediately - but expect it to behave like a table in terms of optimization of SQL/CBO, is not realistic. And pointing to a somewhat flawed understanding of what a pipeline is and how it should be designed and used.

  • Registers the name of the product if there are some Korean internet services, the amount is I want to know how. The way you can communicate with the phone? in adobe Korea

    Registered under the name of product if there are Korean internet services the quantity is I want to know how . The way which you can contact the phone? in Korea Adobe

    Cloud license allows 2 activations http://www.adobe.com/legal/licenses-terms.html

    -Install on a 2nd computer http://forums.adobe.com/thread/1452292?tstart=0

    -https://helpx.adobe.com/creative-cloud/help/sign-in-out-activate-apps.html

    -Windows or Mac has no importance... 2 on the same operating system or 1 on each

    -Two activations on one account CAN NOT be used at the same time (to be noted in the link above of the license)

  • Color of the finding of a pivot with her table column header is by default

    Hello

    I'm trying to find the color code for the default color on the headers of column on PivotTables.

    Any ideas anyone?

    Thank you very much


    -Jenny

    See this link:

    http://obiee101.blogspot.com/2009/05/OBIEE-viewscss-color-cheat-sheet.html

  • How to find child every column foreign keys of tables without index {worm 10 g}

    Hi Experts,

    I have need of a query to find child all the foreign keys of table columns, which are not having an index on the foreign key column.

    Try this.

    SELECT T1. OWNER,

    T1. CONSTRAINT_NAME,

    T1. TABLE_NAME,

    T2. COLUMN_NAME,

    T1. CONSTRAINT_TYPE

    OF ALL_CONSTRAINTS T1,.

    ALL_CONS_COLUMNS T2

    WHERE T1. CONSTRAINT_NAME = T2. CONSTRAINT_NAME

    AND T1. TABLE_NAME = T2. TABLE-NAME

    AND T1. OWNER = T2. OWNER

    AND T1. CONSTRAINT_TYPE = 'R '.

    AND T2. COLUMN_NAME NOT IN (SELECT COLUMN_NAME FROM ALL_IND_COLUMNS T WHERE TABLE_NAME = T1.) TABLE_NAME AND COLUMN_NAME = T2. COLUMN_NAME);

    Post edited by: Parth272025

  • remove the dishes and all references in other table

    Hello
    I want to delete some entries in table1 and all references of this dishes of resistance to other table
    Take as an example
    Table1 (Att1, attr2) attr2 value reference table2(att1-1,att1-2), with the constraint attr2 = att1-1
    I want to know how to do with delete from table1...

    Concerning
    ELYES

    One option is to use the trigger.

    Kind regards.

    LOULOU.

  • How to add the not null columns to an existing table?

    I have a table with hundreds of row inside. I try to add a new column not null. It gives me the following error

    ALTER TABLE sys.xyz CHANGE xyz_no number 4 DEFAULT '1' NOT NULL;

    ORA-02296: impossible to activate (sys.) - found null values

    Also I tried to do the following

    ALTER TABLE sys.xyz CHANGE xyz_no number 4 DEFAULT '1';

    And then I tried to ALTER TABLE sys.xyz CHANGE xyz_NO number 4 NOT NULL; and I still gives me the same error. I took the tally for null values for the same column and has 1555.

    In this case how can I change my article with not null not?. Please help, I am a newbie in oracle.

    I cry out to you for creating a table as SYS. However, I'm going to fully support Sybrand making. Never, ever, create any object as SYS unless the source code received you from Oracle in a patch.

    Now to your question.

    SQL> CREATE TABLE test (
      2  col1 NUMBER,
      3  col2 NUMBER);
    
    Table created.
    
    SQL> INSERT INTO test VALUES (1,1);
    
    1 row created.
    
    SQL> INSERT INTO test VALUES (2,NULL);
    
    1 row created.
    
    SQL> ALTER TABLE test ADD (newcol NUMBER);
    
    Table altered.
    
    SQL> ALTER TABLE test
      2  MODIFY (newcol NOT NULL DISABLE);
    
    Table altered.
    
    SQL> SELECT * FROM test;
    
          COL1       COL2     NEWCOL
    ---------- ---------- ----------
             1          1
             2
    
    SQL> UPDATE test SET newcol = 3;
    
    2 rows updated.
    
    SQL> SELECT * FROM test;
    
          COL1       COL2     NEWCOL
    ---------- ---------- ----------
             1          1          3
             2                     3
    
    SQL> SELECT constraint_name
      2  FROM user_constraints
      3  WHERE table_name = 'TEST';
    
    CONSTRAINT_NAME
    ------------------------------
    SYS_C0036620
    
    ALTER TABLE test ENABLE CONSTRAINT SYS_C0036620;
    
  • How change the taskbar of classic look with a modern look?

    I have a problem with the properties of my Start menu and task bar. The parameters are defined in the Start Menu (the modern look of the most recent), but they present the appearance of the classic view. How can I fix it? as parameters are set on what they should be, but it has not taken effect.

    You can try to change the setting back to "Classic", then "OK" your way and then reassemble the and try to return to the modern creation.  If this does not work, check if the other users on your computer have this problem (create a new user to test if necessary).
    If other users on your computer do not have this problem, then it is likely that you have a corrupt user profile.  To recover, choose one of the following articles:

    "How to recover damaged Windows XP user profile"
      <>http://support.Microsoft.com/kb/555473 >

    "Windows XP problems if your profile is corrupted"
      <>http://support.Microsoft.com/kb/326688 >

    "How to copy data from a corrupted to a new profile in Windows XP user profile"
      <>http://support.Microsoft.com/kb/811151 >

    HTH,
    JW

  • editing a table to add the number of columns fails with ORA-01792

    I'm editing a table to add columns, and ORA-01792 receiver: maximum number of columns in a table or view is 1000. The table of the altar will be no more than 1000 columns. The environment is RHE5 Oracle 11.2. ALTER statement adds a lot of columns in the table, but when I do a manual change to add a dummy column it works, after that, if I run the original the change works!

    What is a table compressed with unused columns?

    This may explain the error with the limit of 1000.

  • Probably an obvious question. How to select an object, i.e. the logo on a track with other tracks above him?

    Hello world

    I have 15 tracks. I have a logo on the second track that spans the length of the video. When I select this logo track in the timeline and then double-click the screen to move the logo, my selection becomes another track. Is there an easy way to click on a specific object on a specific track to move that?

    Thanks in advance.

    Nelson

    As with all first I don't know there are a lot of ways to do so, I click on a track and effect control click query. Then get you the handles for this appearance of track in the program monitor, don't double click the monitor.

  • How update the form element in IR with value when it is null when you press Go?

    Hello

    in an international registration, I created a Date picker component. I want this element when the user enters the page to have a default value. I would also like when the user clears this area the corresponding item to get a default value. I realized the 1 but not the 2nd. I need this replacement to the value of the element because he his need in one between day where expression in the report query and I want to have the bind variable only, not NVL them in order to avoid to analyze all the partitions table. Thi point is used as an additional lookup field in the report and it is included in the elements of the Page to submit. Advanced report attributes.
    How can I do this?

    What I put up the atm:

    The source used
    Still, replacing value that exists in session state

    Type of source
    PL/SQL Expression or a PL/SQL function

    Source of value or expression
    TRUNC (SYSDATE)

    and also in default:

    Default value
    RETURN TO_DATE('01/01/1980','DD/MM/RRRR')

    Default value type
    Body of the PL/SQL function

    TIA

    Mrs..,

    Try this, sorry I did not test it ;)

    onblur="if (!this.value){this.value = $v('PX_HIDDEN_DATE_ITEM')}"
    

    Kind regards
    Dan

    http://danielmcghan.us
    http://www.skillbuilders.com

    You can reward this answer by marking as being useful or correct ;-)

Maybe you are looking for