Get the App
SLTechnology News&Howtos  ›  Database  › 

The method of increasing the original value of mysql

Shulou Source: shulou.com Published: 2022-06-01 03:17:00 10月04日 Update

This article mainly introduces the method of increasing the original value of mysql, which is introduced in great detail and has a certain reference value. Interested friends must finish reading it!

The method to increase the original value of mysql: use the updata function in the format of [update table name set field name = field name + 1 [where statement]].

The method of increasing the original value of mysql:

Format:

Update table name set field name = field name + 1 [where statement]

For example, there is a student table in the database. If you want to add a score to a student whose id is 1,

Update student set score=score+1 where id = 1

If you don't add the where system, you won't know exactly which record you want to update, resulting in an increase of 1 in all the score in the table, unless, of course, that's what you mean.

The above is all the contents of the method of increasing the original value of mysql, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Name original value method field content format statement value interest function student boy partner that is score data database more original intention for example Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB vpn NVidia Shulou Tech Info macOS