国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Mysql add, delete, modify, delete records

Use delete to delete records

CategoryDetailed explanation
Basic syntaxDELETE FROM table [where condition];
ExampleDELETE FROM user where id > 10;
Example descriptionDelete all users with ID greater than 10 in the user table

user table, the table structure is as follows:

##16Chen He1234131.00
idusernamebalance
1王寶強(qiáng)50000.00
2黃曉明150000000.00
15馬云15000.00
mysql> DELETE FROM user where id = 1;

Query OK, 1 row affected (0.08 sec)

Delete the record of the row with ID 1, Li Wenkai.

Clear table records

delete and truncate are the same, but they have one difference, that is, DELETE can return the number of deleted records, while TRUNCATE TABLE returns 0.

If there is an auto-increment field in a table, use truncate table. This auto-increment field will restore the starting value to 1.

CategoryDescriptionBasic syntaxTRUNCATE TABLE table name;ExampleTRUNCATE TABLE user;Example descriptionClear the table data and let the auto-incremented id start from 1

【Remember】

    Be sure to remember to add the where condition when deleting, otherwise the records in the entire table will be cleared.
  1. Be sure to back up, back up, back up before deleting important data.
Continuing Learning
||
<?php echo "Hello Mysql"; ?>
submitReset Code