更新 UPDATE
更新表中特定行
mysql> update customers2 set cust_email = 'abc@example.com' where cust_id = '10006';
Query OK, 1 row affected (0.03 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from customers2;
+---------+----------------+---------------------+-----------+------------+----------+--------------+--------------+---------------------+
| cust_id | cust_name | cust_address | cust_city | cust_state | cust_zip | cust_country

这篇博客展示了如何使用MySQL进行行级别的更新和删除操作。首先,通过`UPDATE`语句更新了`customers2`表中`cust_id`为10006的客户邮箱。然后,再次更新同一行,添加了`cust_contact`字段并设为'abc'。最后,演示了如何使用`DELETE`语句从表中删除特定ID(10004)的记录。
最低0.47元/天 解锁文章
1032

被折叠的 条评论
为什么被折叠?



