How to concatenate two colums into one single column

I need some ideas to concatenate two different columns into one single column using a set of distinct values.
For Example,
Customer Product Number
xyz A 1
xyz B 2
xyz B 1
AAA C 7
AAA A 1
The result should look like this,
Customer Value
xyz A1 B2 B1
AAA C7 A1
How would I group this into once value ?
Thanks in advance ...

Tom's discussion of writing your own aggregate routines
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:2196162600402
starts off with a link to the 8i alternatives
"see
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:229614022562
for 8i methods (not aggregates)"
Unforutnately, it's a lot more work in 8i.
Justin

Similar Messages

  • Concatenate multiple records into one single record

    Hello everyone,
    Can anyone guide me how to merge multiple records into one single record
    like......... I am getting the data in the file like
    aaaaa/bbbbbbb/ccccccccccc/dddddddddddd/eee
    ffffff/gggg/hhhhhhhhhhhhhh
    /123/4567/55555/99999999/kaoabfa/eee
    fffff/kkkkkkkk/llllllllllllllllllllllll
    when i use gui_upload I am getting the data into the internal table in the above format.
    My main intension is to split the record at / to multiple lines and dowload it into another file.
    What i am planning to do is... if the line does not start with / then i want to concatenate the multiple lines into single line and then split it into multiple records. Can anyone guide me how to achieve this.

    Yes, it should work.
    In my example
    Loop at itab.
    concatenate i_text itab into i_text.
    endloop.
    You change that loop for the loop of your internal table with the file records
    So if you have this three records
    'aaaa/bbb/ccc'
    '/dddd/efg'
    'hijk/lmn'
    i_text will look like this at the end
    'aaaa/bbb/ccc/dddd/efghijk/lmn'
    then in this part of the code
    split i_text at '/' into table itab2.
    itab2 will have the records looking like this
    aaaa
    bbb
    ccc
    dddd
    efghijk
    lmn'

  • SQL*Loader - How to combine Flat File 3 columns and put into one single column

    Receive a flat file delimited by comma. Want to combine Flat File last 3 columns and put into one single column(Table).
    e.g.
    Flat File
    100,239,30,20,30
    While inserting into table want to combine last 3 columns and insert into invoice number column.
    302030

    It is not possible to combine the last 3 columns as those columns are seperated by commas and in the SQL Loader control file you must ve specified COMMA as an delimiter. So u better have all the columns in the table plus add one more column which holds the concatenation of the 3 columns.
    Vijay

  • How to Combine two queries into One

    Hi Gurus,
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Release 10.2.0.4.0 - 64bit Production
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL>
    I have following two queries. How I can convert these two queries into one with the same result ?
    Q1
    SELECT id,vdate,vendorname,venddate,vid
    FROM VENDOR
    WHERE processid=32
    AND venddate is null
    AND vid in(select vid from view_vid where type='PDX')
    AND (id,vdate) not in (select id,vdate from vkfl_is where task_id=55)
    AND (id,vdate) in (select id,vidate from market_data where marketed_date is null)
    AND id not in (select id from location)
    Q2
    SELECT id,vdate,vendorname,venddate,vid
    FROM VENDOR
    WHERE processid=20
    AND venddate is null
    AND vid in(select vid from view_vid where type='PBX')
    AND (id,vdate) not in (select id,vdate from vkfl_is where task_id=40)
    AND (id,vdate) in (select id,vidate from market_data where region_date is null)
    AND id not in (select id from location)
    I can UNION these two queries, but, is there any way I can write a single query with which gives me same result as above two queries?
    Any help would be highly appreciated
    Thanks in advance

    Hi,
    You can do something like this, which will be more efficient than a UNION:
    SELECT  id, vdate, vendorname, venddate, vid
    FROM  vendor
    WHERE  (   (    -- Conditions that apply only to q1
                               processid = 32
                AND  vid       IN (SELECT vid FROM view_vid WHERE type = 'PDX')
                AND (id,vdate) NOT IN ( SELECT id, vdate
                                        FROM   vkfl_is
                                        WHERE  task_id = 55
                AND (id,vdate) IN ( SELECT id, vidate
                                    FROM   market_data
                                    WHERE  marketed_date IS NULL
            OR  (  -- Conditions that apply only to q2
                     processid = 20
                AND  vid       IN (SELECT vid FROM view_vid WHERE type = 'PBX')
                AND (id,vdate) NOT IN ( SELECT id, vdate
                                        FROM   vkfl_is
                                        WHERE  task_id = 40
                AND (id,vdate) IN ( SELECT  id, vidate
                                    FROM  market_data
                                    WHERE  region_date IS NULL
                   -- The remaining conditions apply to both q1 and q2
    AND     venddate   IS NULL
    AND     id         NOT IN (SELECT id FROM location)
    I hope this answers your question.
    If not, post  a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How to Combine Two SubPaths into a Single SubPath

    For CS 5, ActionScript:
    I have a Path which contains two subpaths, which may or may not overlap.
    How do I combine them into a single SubPath (i.e., union) via scripting?
    I know that in the GUI, I can select both SubPaths and then press the "combine" button - this is the effect I want.
    TIA,
    mlavie

    This should combine the first path in the Paths Panel:
    // 2012, use at your own risk;
    #target photoshop
    if (app.documents.length > 0) {
    var myDocument = app.activeDocument;
    if (myDocument.pathItems.length > 0) {
    myDocument.pathItems[0].select();
    // =======================================================
    var idcombine = stringIDToTypeID( "combine" );
        var desc10 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref7 = new ActionReference();
            var idPath = charIDToTypeID( "Path" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref7.putEnumerated( idPath, idOrdn, idTrgt );
        desc10.putReference( idnull, ref7 );
    executeAction( idcombine, desc10, DialogModes.NO );

  • How to turn two users into one?

    Hey there!
    As I selled my MBP last month I copied all its datas to my iMac via migration assistant and created a new user for it. So I have now two accounts with different photos, documents etc.
    My problem now is how to turn these two users into one?
    I want all my photos appear in Aperture of my first user, I want all my documents appear in "Documents" of the first user and so on..
    Is it able? If yes, how could I realize it?
    Thanks for your support!
    René
    PS: 2 Users on iMac -> 1 User on iMac.

    Thanks for your help at first.
    But you usually can't "merge" two "normal" user accounts successfully.  If both accounts have data for the same application, it will be very difficult or impossible to merge them by copying files & folders.
    I cannot merge them.. So there is the question how to copy all medias from Aperture to my other Aperture medias?
    Can I export my whole medias and import in at the other users Aperture? And how? #
    Edit: I dont want to have two different libraries at all.. I want them to be together in just one..

  • How to open two sockets in one single server

    May I open two sockets with different listening port numbers in a single server? For each socket, the way to deal with the inputstream and outputstream is different. May the thread be like this:
    public class twoSocketServer implements Runnable {
    public twoSocketServer() {
    try{
    SSLServerSocketFactory fact = SSLServerSocketFactory.getInstance(rand, selfPrivateKey, selfCertificate, trustEngine, null);
    serverSocket1 = (SSLServerSocket) fact.createServerSocket(ListeningPort1);
    serverSocket1.setNeedClientAuth(false);
    serverSocket2 = (SSLServerSocket) fact.createServerSocket(ListeningPort2);
    serverSocket2.setNeedClientAuth(false);
    } catch {...}
    public void run()
    while(true)
    try
    SSLSocket socket1 = (SSLSocket) serverSocket1.accept();
    new handler1(socket1).start();
    SSLSocket socket2 = (SSLSocket) serverSocket2.accept();
    new handler2(socket2).start();
    } catch {...}
    class handler1 extends Thread {...}
    class handler2 extends Thread {...}
    Is there something wrong with this idea? If yes, how can I correct it? Thanks.

    try
    SSLSocket socket1 = (SSLSocket)
    serverSocket1.accept();
    new handler1(socket1).start();
    SSLSocket socket2 = (SSLSocket)
    serverSocket2.accept();
    new handler2(socket2).start();
    Is there something wrong with this idea? If yes, how
    can I correct it? Thanks.You can do it.
    In the above code block you are going to need two threads. One for each SocketServer. The accept() method blocks until it recieves a connection. So in your above code it would first wait only for a connection on port 1. Then it would wait only for a connection on port 2. And then start over. That probably isn't what you want.

  • How to concatenate multiple records into one

    Hi everybody:
    I want to know if exist some way to concat multiple records into one without using cursors. For example, I have a table named "Authors" like this:
    Lan|Author
    English|Ernest Hemingway
    Spanish|Octavio Paz
    Spanish|Mario Vargas Llosa
    English|Sinclair Lewis
    Spanish|Gabriel García Márquez
    And I want to get this:
    Author
    Octavio Paz, Mario Vargas Llosa, Gabriel García Márquez
    I have worked with SQL Server and I can do something like this:
    CREATE FUNCTION dbo.MyConcat (@lan varchar(10))
    RETURNS varchar(5000) AS
    BEGIN
    declare @retvalue varchar(5000)
    set @retvalue=''
    select @retvalue = @retvalue + Author +',' from Authors where lan = @lan
    return substring(@retvalue,1,len(@retvalue)-1)
    END
    ie, do not use cursors to concatenate records. However, with ORACLE, I have to do someting like this.
    FUNCTION MyConcat(P_Lan IN VARCHAR2) RETURN VARCHAR2 IS
    v_ret VARCHAR2(4000);
    v_element VARCHAR2(4000);
    v_cursor sys_refcursor;
    BEGIN
    OPEN v_cursor FOR SELECT Author FROM Authors where Lan = P_Lan
    LOOP
    FETCH v_cursor INTO v_elemento;
    EXIT WHEN v_cursor%NOTFOUND;
    IF v_ret IS NULL THEN
    v_ret := v_element;
    ELSE
    v_ret := v_ret || ', ' || v_element;
    END IF;
    END LOOP;
    RETURN v_ret;
    END;
    Exist some other way to do this?
    Best Regards
    Jack

    Tks both for answer... I forgot to mention that I am using Oracle 10g. I read about LISTAGG() but this function is available for Oracle 11g release 2.
    I wil read about the other techniques than Hoek mention
    Best Regards.
    Jack

  • How to make two files into one?

    I got two .iso files I would like to make into one file.
    What program can I use for this process? And step-by-step if possible.

    For disk images, if either of them is a read/write image, you can simply mount them both, drag the contents of one into the contents of the other, and unmount again. (Edit: just re-read your post; .ISO files are read-only so you will need to either follow the below instructions, or convert the ISO to a read/write DMG by dragging it into the left panel of Disk Utility and using the Images-Convert menu.)
    If they are both read-only, you'll need to create another disk image to contain them - use Disk Utility for this (File - New - Blank Disk Image), set the required size and properties, and once it's mounted, drag the contents of both .ISO images into it.
    Matt
    Message was edited by: Matt Clifton

  • How to combine two albums into one

    I imported into iTunes two Shostakovich compositions so that I could burn a CD-R that contained these two works. The CD burning went fine, but iTunes insists on separating the two compositions into two albums in the display of all albums. I have made sure that the album titles and the artists displayed under the album icons are identical, but still the two will not meld into one. Will someone help me with this? I am using iTunes 9.2.1(4).

      On the "Get Information" windows (reached with right clicks) of the two separated albums, one album was marked as "no" on the "part of a compilation" option and the other was marked "yes". I changed the "no" to a "yes" and they merged. I'm not sure if I got this from the site you gave me or if I just stumbled on to it. Either way, I thank you for your kind responses.

  • How to club two rows into one

    hi
    Can we club two rows of a SQL statement into one , that is some column results from one row and other column result from second row, but the row must remain same .
    thanks
    imran

    SQL> with sample as (select 'A' supplier, 1000 total, 0 branch_total from dual
      2                union all
      3  select 'A' supplier, 0 total, 500 branch_total from dual
      4                union all
      5  select 'B' supplier, 300 total, 0 branch_total from dual
      6                union all
      7  select 'B' supplier, 0 total, 120 branch_total from dual)
      8  SELECT SUPPLIER , SUM(TOTAL) , SUM(BRANCH_TOTAL) FROM SAMPLE
      9    GROUP BY SUPPLIER
    10  /
    SUPPLIER SUM(TOTAL) SUM(BRANCH_TOTAL)
    A              1000               500
    B               300               120

  • How to copy Two universes into a Single universe

    Hi ,
    I am working on SAP BO 3.1 Designer ,
    I have three universes namely A,B& C which are pointing to same data base and with the same connection
    now I would like to combine the universes
    can u please suggest me on this..
    I would like to have the components of Universe A & B. in universe C..
    Thanks In Advance..

    Hi,
    I think, you are asking for the linking of multiple universes into a single universe and this is compatible with SAP BO 3.1 Designer
    Steps to Link Multiple Universes to a Single Universe with same Database and Connection
    1. Create a Universe A (for instance) with proper parameters mentioning the Database and Valid Connections
    2. Go to File >> Parameters >> Links tab and then Click Add Link
    3. Then point the Universe B you wish to link
    4. Similarly add a link to the other Universe C and then export the the Universe after saving to the repository.
    ** These universes are dynamically linked to the universe and the Objects, classes will be made available.
    Thanks and Regards,
    Arul Frances S

  • Concatenate two rows into one drop down? Not order them though

    Ok I have two rows:
    Group
    Original Performance NorGrip
    Gold Blank Disc
    Gold Blank Disc
    Truckbed Liner Kit
    Then I have another one:
    Attribute
    Grade
    Grade
    Dimensions
    However, I don't want them combined on top of one another.
    I want it so a person can select like so:
    Original Performance NorGrip Grade
    Gold Blank Disc Grade
    Gold Blank Disc Dimensions
    Truckbed Liner Kit (no value in the other column)
    The truckbed liner kit has no attribute value in the column so I would rather the option not show at all... So as long as the attribute column is filed, combine the two and show it in a validation list..
    I know how to create lists and then make them validation lists, but this is stumping me..

    From your example and description, I'm not sure I understand what you are starting with. Do you have a grid (group, etc across the top; attribute etc in rows, with som marker that shows which combinations are valid and which arent? Or do you have two rows
    (or columns) that /only/ contain the valid combinations?
    If you have them in two rows (or columns) containing only the valid combinations, then you can insert a third row (or column) as a helper column and just concatenate the two values, like A3 =A1 & " " & A2
    Then either use that range to feed your validation list on the same page, or turn it into a named range and feed a validation list on another sheet.

  • Satellite L40-18Z: How to merge two partitions into one partition?

    Hello,
    I have a satellite L40 with a hard disk drive partitioned into two ( C and E ), one having 37GB capacity the other almonst 36 GB.
    The C drive is almost full and the E drive almost empty. I would like to take away the partition and have just one drive, is this possible.
    Any advice would be gratefully received. I am not a techi so be kind.
    Regards
    Peter

    Hi
    Of course this is possible
    You can do this in disk management.
    Just click right on My Computer -> Manage
    Here choose disk management.
    Now you have to delete the E partition. Then the free space could be added to the C partition.
    But note; before you would do this, create the recovery disk (if you didnt this in the past.)

  • How to Print two layouts into one page

    Hi,
    I have developed a report by blocked ALV.In this report i have created two blocks.
    But when i give print out the two blocks are not printing continuously.It is displaying one block in one page and another block in anther page.
    And i need page number at end of each page.
    Please provide me solution for this.
    Thanks & Regards
    Venkatrami Reddy B

    OOPS – OO ABAP
    http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
    http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
    http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    Reports
    http://www.sapgenie.com/abap/reports.htm
    http://www.allsaplinks.com/material.html
    http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    Rewards if useful.........
    Minal

Maybe you are looking for

  • WM-PP : Backflush a material from different bins in the same storage Type

    Hi Gurus, We have a business scenarion where we do manual staging for production , the staging area has different bins within the same storage type for the same material, I am wondering if there is a way to backflush the material from different stora

  • TNEF Issue - Winmail.dat or messages stuck in submission queue

    Hi guys,  I've looked around the forums and have found people that have had submission queue issues when they set TNEF to $null or $false, and have found that the unified answer is to set TNEF to $true. I also see folks having issues with recipients

  • How to restore XP Mode from backup VHD file?

    Hi, Please can you give us some steps on how to restore from these backups? I have Windows 7 Professional, 64-Bit . I have XP Mode looking nice now, with my legacy game installed and running nicely I have created a folder called C:\XP Mode Backups Ap

  • [TV@Plus] x64 Drivers

    Anyone know if there is a way to get the TV @nywhere Plus to work under x64? Or when the drivers will be released?

  • Logging for a specific ACL line

    Hello, I'm currently evaluating rules on ASA. There are some rules applied, but some of the traffic does not match those rules. I created a rule allowing everything and I need to see what traffic is hitting this especific rule on line 3. Example: acc