亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Delete Record

Use delete to delete records


QQ截圖20161009162523.png


##user table, the table structure is as follows:


QQ截圖20161009162532.png


##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 to restore the starting value to 1.


QQ截圖20161009162540.png

QQ截圖20161009162544.png


#【Remember】

1. When deleting, be sure to remember to add the where condition, otherwise the records in the entire table will be cleared.

2. Be sure to back up, back up, back up before deleting important data.

Continuing Learning
||
<?php echo "Hello Mysql"; ?>
submitReset Code