How to union mulitple itemset column with another  tables

Hi ,
i have the following table called itemset 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 those 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 ,
Edited by: user11309581 on Jun 26, 2011 10:43 PM
Edited by: user11309581 on Jun 26, 2011 10:47 PM

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.

Similar Messages

  • How to update the COST column using another table's column

    Dear All,
    I have table:
    table parts: pno, pname, qoh, price, olevel
    table orders: ono, cno, eno, received, shipped
    table odetails: ono, pno, qty
    view:orders_view: ono, cno, eno, received, shipped,sum(qty*price)order_costview:odetails_view: ono, pno, qty, (qty*price)cost
    after I update the price in parts, I need to update COST and ORDER_COST too. The orders_view does not have pno, qty, and price, the odetails_view does not have price, how can I update the COST and ORDER_COST. Please help and Thanks in advance!!!
    I wrote the update the price in parts:
    create or replace procedure change_price(ppno in parts.pno%type, pprice in parts.price%type) as
    begin
        update parts
        set price = pprice
        where pno = ppno;
    end;
    show errorsthis procedure works fine.
    I wrote the trigger:
    create or replace trigger update_orders_v
    after update of price on parts
    for each row
    begin
        update orders_view
        set order_cost = sum(parts.(:new.price)*parts.qty)
        where parts.pno = :new.pno;
    end;
    show errorsIt gives me:Errors for TRIGGER UPDATE_ORDERS_V:
    LINE/COL ERROR
    3/5 PL/SQL SQL Statement ignored
    4/22 PL/SQL ORA-00934: group function is not allowed hereplease help!

    You could add the columns to the tables and then you would need a trigger to update those columns. However, you could just as easily select the price * qty to get the cost, without creating an additional column or trigger. I have no idea what you might want to do with a global temporary table. I think you need to explain what your purpose is, before any of us can suggest the best method. Since I have already demonstrated an update with a view, I will demonstrate an update with the cost column added to the odetails table and a trigger as you asked about. Notice that you will need triggers on both tables, the one that has qty and the one that has price.
    scott@ORA92> create table parts
      2    (pno    number(5) not null primary key,
      3       pname  varchar2(30),
      4       qoh    integer check(qoh >= 0),
      5       price  number(6,2) check(price >= 0.0),
      6       olevel integer)
      7  /
    Table created.
    scott@ORA92> create table odetails
      2    (ono    number(5),
      3       pno    number(5) references parts,
      4       qty    integer check(qty > 0),
      5       cost   number,
      6       primary key (ono,pno))
      7  /
    Table created.
    scott@ORA92> create or replace procedure change_price
      2    (ppno   in parts.pno%type,
      3       pprice in parts.price%type)
      4  as
      5  begin
      6    update parts
      7    set    price = pprice
      8    where  pno = ppno;
      9  end;
    10  /
    Procedure created.
    scott@ORA92> create or replace trigger update_cost1
      2    after insert or update of price on parts
      3    for each row
      4  begin
      5    update odetails
      6    set    cost = qty * :new.price
      7    where  pno = :new.pno;
      8  end update_cost1;
      9  /
    Trigger created.
    scott@ORA92> show errors
    No errors.
    scott@ORA92> create or replace trigger update_cost2
      2    before insert or update of qty on odetails
      3    for each row
      4  declare
      5    v_price parts.price%type;
      6  begin
      7    select price
      8    into   v_price
      9    from   parts
    10    where  pno = :new.pno;
    11    --
    12    :new.cost := :new.qty * v_price;
    13  end update_cost2;
    14  /
    Trigger created.
    scott@ORA92> show errors
    No errors.
    scott@ORA92> insert into parts values (1, 'name1', 1, 10, 1)
      2  /
    1 row created.
    scott@ORA92> insert into odetails values (1, 1, 22, null)
      2  /
    1 row created.
    scott@ORA92> -- starting data:
    scott@ORA92> select * from parts
      2  /
           PNO PNAME                                 QOH      PRICE     OLEVEL
             1 name1                                   1         10          1
    scott@ORA92> select * from odetails
      2  /
           ONO        PNO        QTY       COST
             1          1         22        220
    scott@ORA92> -- update:
    scott@ORA92> execute change_price (1, 11)
    PL/SQL procedure successfully completed.
    scott@ORA92> -- results:
    scott@ORA92> select * from parts
      2  /
           PNO PNAME                                 QOH      PRICE     OLEVEL
             1 name1                                   1         11          1
    scott@ORA92> select * from odetails
      2  /
           ONO        PNO        QTY       COST
             1          1         22        242
    scott@ORA92> -- select works without extra cost column or trigger:
    scott@ORA92> select o.ono, o.pno, o.qty, (o.qty * p.price) as cost
      2  from   odetails o, parts p
      3  where  o.pno = p.pno
      4  /
           ONO        PNO        QTY       COST
             1          1         22        242
    scott@ORA92>

  • How do I share multiple contacts with another iPhone?

    How do I share multiple contacts with another iPhone? Thanks in advance.

    What do you mean share? 
    It is not possible to send contacts from one iPhone to another without installing an app that would support this.  Bump is one such app.
    There is no functionality in iOS to do this.  iCloud can share contacts across multiple iDevices, but it would be ALL contacts, just just a few.

  • There is no 'Save as' under the file menu.  How do I save a file with another name?

    Numbers help refers to the 'Save As' function in the File menu.  My version (latest) does not have a 'Save As' function.  How do I save a file with another name?

    Ross Millard wrote:
    Badunit. You have an original file and an edited file. Now you duplicate the edited file and save it with a different name. Now do you have to go and delete the changed file from which the duplicate had been made? And.... is the original still unchaned... still original?
    Ross,
    For the situation you describe, Apple has provided Duplicate and Revert. Use File > Duplicate to reach this menu:
    Regards,
    Jerry

  • How to publish Motion 5 templates with another editor's Final Cut Pro x

    How to publish Motion 5 templates with another editor's Final Cut Pro x

    That's also simpel,
    Let the Motion 5 designer deliver the map that he made. For example he made a title effect with the title "We Are Awesome Company Title" than you get that map after the head "Effects" map. So he must send that map with all the stuff in it to an editor and the editor place that map in Motion Templates -> Effects.
    Restart Final Cut Pro X and there you go.

  • How do I insert a section with another time signature than the one im inser

    How do I insert a section with another time signature than the one im inser

    Yeah I've been trying to figure this out as well, for example... my song might be 90 bpm and I want to program another track using midi but have it play at 180 bpm. The only way I've found to work around this is to write my 180 bpm part make a sample of this and then loop this into the 90 bpm song.

  • In Pages how do I save a file with another name

    In Pages how do I save a file with another name?

    I don't know if there is a less cumbersome way to do this (I'm still pretty new to Lion) but This is what I do - since "Save As" seems to be gone with Lion.
    I create a duplicate document - then click the red button to close the document - and a dialog box pops up and asks if you want to save the changes - I change the name in there and then save the file under the new name.
    You can also save the copy to the desktop - get info - and then change the name if the finder window.
    I copied this from the Pages help area. These help instructions were created pre-Lion I'm sure.
    Saving a Copy of a Document
    If you want to make a copy of your document—to create a backup copy or multiple versions, for example—you can save the document using a different name or location. (You can also automate saving a backup version, as Automatically Saving a Backup Version of a Document describes.)
    To save a copy of a document: 
    Choose File > Save As and specify a name and location.
    The document with the new name remains open. To work with the previous version, choose File > Open Recent and choose the previous version from the submenu.

  • How to convert rows into columns with decode function

    Hi,
    How to convert rows into columns with the help of decode function in oracle.
    thanks and regards
    P Prakash

    say
    col1 col2
    1 10
    2 20
    3 30
    then use
    select col1,
    sum(decode(col2,10,10)) "new1"
    sum(decode(col2,20,20))"new2"
    sum(decode(col2,30,30))"new3"
    from table_name
    group by col1;
    we used sum u can use ny function if wont u have to give the column name i.e col2 name also
    so i think u got it nw
    regards

  • HT204266 how can I update my app with another account?

    how can I update my app with another account?

    kambiz.fakhr wrote:
    how can I update my app with another account?
    Anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID
    Apple ID FAQs  >  http://support.apple.com/kb/HT5622

  • How do I autofill a column with numbers increasing by 1?

    How do I autofill a column with numbers increasing by 1?

    Hi Patricia,
    Type in your first 2 values. Select both and drag the yellow dot down to fill the remainder.
    quinn

  • My pc broke! How can I syncronize my iphone with another pc?

    My pc broke! How can I syncronize my iphone with another pc?

    You can only sync with one computer, do you not have a backup of your library to transfer to the new computer?
    If not the only way is to transfer purchases
    http://support.apple.com/kb/ht1848
    http://support.apple.com/kb/ht1727
    For non-purchased content you will need to find a 3rd party app

  • How do I share contact details with another contac...

    How do I share contact details with another contact suing Skype for Windows 8. When I right click on the contact I do not see the option "Share Contact" any more. Any ideas?

    What do you mean share? 
    It is not possible to send contacts from one iPhone to another without installing an app that would support this.  Bump is one such app.
    There is no functionality in iOS to do this.  iCloud can share contacts across multiple iDevices, but it would be ALL contacts, just just a few.

  • How can I share my screen with another apple computer?

    How can I share my screen with another apple computer?

    By enabling Screen Sharing in the Sharing preferences. Both computers need to be connected to your local network, preferably by Ethernet.

  • How can I relate the fields a table column to the headers of the columns in another table?

    Here is my problem:
    I have a table where the first column is a list of types of characteristics and I want to compare that column with a table which has some columns, each one with a type of charasteristic.
    It's like relating a column to a file (the header file).
    PD: My level is beginner.

    Well I don´t want the space on both sides of the input text to be that big either so that doesn´t solve the problem.

  • How to provide Link to Column in  the Table

    Hi
    please let me know how to provide link to one column in the table.
    i have two views
    in one view i will dispaly emp id and emp dept in a table
    i have to provide link to the emp id column table
    when i click emp id column then it will fire other view and display remaining details of emp.
    so please let me know how to provide link to column in the table.
    Solution is urgent
    regards
    mmukesh

    Hi Mukesh,
       You can insert LinkToAction column in table.you can have two cattributes in Valuenode one is of type boolean and other is of type string(empno)
    you can create eventhander in that you can fire plug to seconf view where you can displays the emp details
    With Regards
    Naidu

Maybe you are looking for