Merger in two row

  • Hi;

    I want merge the two rows is not null values.

    Here my table

    id name old new

    1 test Null 5

    1 test 6 Null

    How can i merger the two row

    Result format

    Id name Old New

    1 test 6 5

    any one help for this problem..

  • Select id,name,sum(old),sum(new)

    From Test1

    Group By id,name

    this will solve the purpose but will be the creteria that you need to merge these rows. will it be always null values or you will have values other than null

  • Select id,name,sum(isnull(old,0)),sum(isnull(new,0))

    From Test1

    Group By id,name

    this could also work

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

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