Combining Two Records in to 1

  • Good day Experts,

    How can i combine these two rows into one in sql .So i want it to be one row.

    Sample_data

    Many thanks

  • What do you want to see if the values are different? Which value takes precedence?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • If I'm thinking the same way as you, just use SUM on each column with a GROUP BY on what you have in the left-most column.

    Also, this isn't your first time on this forum... you know if you want a coded example, you need to provide "Readily Consumable Data".  Please see the article at the first link in may signature line for one of many ways to do that.

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply