更改表中的数据:1、更新特定行;
2、更新所有行。
注意:更新时一定要注意添加上where条件,否则,更新表中所有行数据。
格式: 更新特定行:update table
set table_xxx='aaaaaa'
where table_id='bb';
更新多行:update table
set table_xxx='aaaaaa',
table_city='cc',
……
table_name='dd'
where table_id='bb';
示例:update customers
set cust_email='1111@126.com'
where cust_name='yang'
要想删除表中的某个列的值,可设置它为NULL(假定表定义允许NULL值)。
update customers set cust_email='null ' where cust_name='yang'
NULL用来去除cust_email列中的值,NULL表示没有值。而字符串‘’表示一个值。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。