#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2011
    Posts
    1
    Rep Power
    0

    Aggregate two columns


    I have two table and I want to merge them

    TERMS_TABLE
    ID | TERMS
    309 | 'hardware'
    309 | 'software'
    309 | 'computer'


    TFIDF_TABLE
    ID | TERMS
    309 |'computer,phone,mp3....'


    Now I want to add TERMS column of TERMS_TABLE to terms column of TFIDF_TABLE but If TFIDF_TABLE already contains TERMS of TERMS_TABLE then I should not insert this term to the NEW_TFIDF_TABLE , like that

    result should be:

    NEW_TFIDF_TABLE
    ID | TERMS
    309 |'computer,phone,mp3....,hardware,software'

    How can I do that ?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2011
    Posts
    3
    Rep Power
    0
    try like this...

    select
    deptno,
    rtrim (xmlagg (xmlelement (e, ename || ',')).extract ('//text()'), ',') enames
    from
    emp
    group by
    deptno
    ;

IMN logo majestic logo threadwatch logo seochat tools logo