Combining multiple rows into one row

  • I have a table in sql server which has more than 100 columns with rows like this

    eg:

    IDKEY INTKeyHRISTRID1CID SEGTLTMP

    71073287877699983913102552184046D2000

    71072766877699983913102552184046D20.610.21050.24

    71072767877699983913102552184046D300.261059.71

    71073288877699983913102552184046D30.8100

    71073288877699983913102552184046D3000

    71072566877699983913102552184046D400.330

    71072768877699983913102552184046D41.020

    71073870877699983913102552184046D4001062.8

    I need to combine the rows with same CID and SEG into one row and delete the others.

    eg

    IDKEY INTKeyHRISTRID1CID SEGTLTMP

    71073287877699983913102552184046D20.610.21050.24

    71072767877699983913102552184046D30.810.261059.71

    71072566877699983913102552184046D41.020.331062.8

    How can this be done??

  • will GROUP BY and MAX do it to get the new rows?

    edit...whats the business rule for IDKEY...??

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

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

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