update column where is null

  • hi

    i have a two table

    select*from phon

    phone ASA

    111 james

    222 stivens

    333 null

    444 null

    select*from t2

    phone ASA

    111 james

    222 stivens

    333 jacke

    444 lee

    select*from phon where ASA is null

    333 null

    444 null

    how i make update

    table phon column ASA only ASA is null

    after update table phon

    for example

    select*from phon

    phone ASA

    111 james

    222 stivens

    333 jacke

    444 lee

  • update t1 set

    t1.Asa = t2.asa

    From phone

    Inner join table2 on t2.phone=t1.phone

    Where t1.asa is null

    Should do it.

    __________________________________________________________________________________________________________
    How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • thank you veruy much

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

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