Dovberman
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,
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Works perfectly,
Thanks,
Thanks,
ASKER
Works perfectly,
Thanks,
Thanks,
ASKER
I will try this later today and reply.