MySQL Forums
Forum List  »  Connector/Python

Update value and reset on reaching value?
Posted by: Tull Clancey
Date: October 23, 2018 11:41AM

Hi there, I'm hoping I can do this in a begin-commit statement, I've been looking at it, but can't get it right.

I have a field Counter

I need to increment the counter until it hits x then reset the counter to 0.

if x<10 then x+=1 else x=0

I"m using the python connector if it makes any difference.

I can do this in multiple calls, but that feels like admitting defeat!

Many thanks.

ps, years ago I picked up a quick reference guide for MsMql which helped me with their syntax greatly, I've been away from serious database work for years and have forgotten most it. Can anyone suggest a good quick ref for MySql that's kindle friendly?

Thanks.

Options: ReplyQuote


Subject
Written By
Posted
Update value and reset on reaching value?
October 23, 2018 11:41AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.