Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 386

Update value and reset on reaching value? (1 reply)

$
0
0
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.

Viewing all articles
Browse latest Browse all 386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>