简体   繁体   中英

MySQL.. What should be the query

I need your help.

I have a table named Users and in the columns id, name, age, ageMax.

What should be the query which increase each user age of 1 if his age is less than ageMax?

Try something like that:

Update Users
Set age = age + 1
Where age<ageMax

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM