for update statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinodkumar1086
    New Member
    • Oct 2007
    • 2

    for update statement

    Hello,

    There are 2 tables. consider ..

    table A table B
    --------------- --------------------------
    col1 col2 col1 col2
    aa 111 aa
    bb 2222 bb
    ccc 33 ccc 34


    some of the values in the col2 are null. can u tell me how to write an update statement where we has to fill the null values with the col2 values from tableA to the tableB.. can you please reply with me as soon as possible...
  • dewa81
    New Member
    • Jul 2007
    • 14

    #2
    update tableb a set col2=(select col2 from tablea b where a.col1=b.col1)
    and a.col2 is null

    Comment

    Working...