Link to home
Start Free TrialLog in
Avatar of Todd Penland
Todd PenlandFlag for United States of America

asked on

Help Needed With Query

I need help with one more Query and then I'm done.  For this one, I need to update the SinceLastAssigned value for every participant who has a value of zero to the MAX value in that column, plus one (in the case of the data presented, that would be 176).  Please let me know if you have any questions.  Appreciate the help!

User generated image
Avatar of Qlemo
Qlemo
Flag of Germany image

Is 176 the value for all rows having a zero?
Avatar of Todd Penland

ASKER

Yes, that's correct.   I'm assuming that this can be done in one query but the first part (of course) has to be identifying the maximum value in the since last assigned column, then updating all the rows where the value is 0 to that maximum value plus one.  Hope that helps.
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany 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
Hi,

I agree with Qlemo,

You can Update
Update Tbl set sinceLastAssigned = (SELECT max(sinceLastAssigned) from Tbl)  +1
WHERE sinceLastAssigned = 0

Open in new window

Thank you very much, this was exactly what I needed!