Answered sql query question

  • Monday, May 30, 2011 4:20 PM
     
     

    I have the below table and need to update values in row_id column from row_id_old. row_id should have value of row_id_old where  sortorder=1. I have shown the output below

     

    ID    ROWID      ID_OLD   ROW_ID_OLD   sortorder

     

    1        NULLL     100          10                    1

    1         NULL      200         32                    0

    1           NULL     300         23                   0

    2        NULL         320        42                  1

    2         NULL        456       39                  0

     

    --------------------------------------------

     

     

    ID    ROWID      ID_OLD   ROW_ID_OLD   sortorder

     

    1        10     100          10                    1

    1         10      200         32                    0

    1          10    300         23                   0

    2        42         320        42                  1

    2         42        456       39                  0

All Replies