DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: How to Merging Column

  1. #1
    Join Date
    Nov 2003
    Posts
    1

    How to Merging Column

    Hi I have one table lets say "Vendor" with data :

    PROJECT_ID CLIENT_NAME SP_NAME GC_NAME

    1 Diligent & Co. NULL NULL
    12 Diligent CLIENT. NULL NULL
    11 NULL Tata_InfoTech NULL
    12 NULL NULL TISCO
    12 NULL Diligent_Cosco. NULL
    11 Diligent_Delhi NULL NULL
    16 NULL Diligent_INCL HCL Tech
    16 NULL NULL WIPRO Tech

    Now I want to create a view "SomeView" out of this which should return me only one row for each project_ID

    so the output should be

    PID CLIENT_ID SP_ID GC_ID

    1 Diligent & Co. NULL NULL
    11 Diligent_Delhi Tata_InfoTech NULL
    12 Diligent_CLIENT Diligent_Cosco TISCO
    16 NULL Diligent_INCL WIPRO_TECH


    Assumption here is that for each project_ID there will be only one CLIENT, only one GC and only one SP



    Can someone help me in achieving this

    Regards
    Lotu

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    select PID,
    max(CLIENT_NAME),
    max(SP_ID),
    max(GC_ID)
    from ...
    group by pid


    by the way, that design really sucks.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width