07 Modify data

1. Modify all data
UPDATE table_name
SET {col_name = EXPRESSION}[,...n]
Example 1: Change all users gender to male

UPDATE users SET user_sex = '男'

Example 2: Increase all game scores of all players by 100 points

UPDATE scores SET score = score+100

2. Modify the characteristic data
UPDATE table_name SET {col_name = expression}[,...n] WHERE condition_expression
Example: Change the gender of players whose QQ is "12302" to female.

UPDATE users SET user_sex = "女" WHERE user_qq = "12302"

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324935987&siteId=291194637
Recommended