Link to home
Start Free TrialLog in
Avatar of Dovberman
DovbermanFlag for United States of America

asked on

SQL Statement to Update Rows on Condition

I have duplicate rows in a table. All column values are equal except one numeric column.
I need to set a column value for the lowest Col3 value in each group.

Col1         Col2           Col3             Col4

1808      AA      30175130          1   Set Col4 to 0 for the min Col3 value of the AA Group
1808      AA      30176132          1
4450      AAN      30175454          1   Set Col4 to 0 for the min value of the AAN Group
8384      AAN      30175787          1
8385      AAN      30175788          1
4450      AAN      30177864          1
8384      AAN      30178679          1
8385      AAN      30178680          1

How can this be done?

Thanks,
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dovberman

ASKER

Thank you,

I will try this later today and reply.
Works perfectly,

Thanks,
Works perfectly,

Thanks,