help with update sql

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Whocares

    help with update sql

    Hi,

    I think it should be an easy sql but I'm stuck and I could use some help
    here ...

    Table:

    U1 U2 Ref Gro
    1 1 1 1
    2 2 2 1
    1 1 3 1
    a a 1 2
    b c 2 2
    c a 3 2

    I want to update the U1 and U2 columns where Ref>1 with the values from the
    row where Ref=1 but grouped by Gro - eg wanted result:

    U1 U2 Ref Gro
    1 1 1 1
    1 1 2 1
    1 1 3 1
    a a 1 2
    a a 2 2
    a a 3 2


    TIA,
    Zsolt


Working...