更新和删除数据

2015/07/09 数据库开发

更新数据

UPDATE Customers
SET cust_email='kim@thetoystore.com'
WHERE cust_id='10000005'
UPDATE Customers
SET cust_contact='Sam Roberts',
	cust_email='sam@toyland.com'
WHERE cust_id='1000006';

为了删除某个列的值,可设置它为NULL

UAPDATE Customers
SET cust_email=NULL
WHERE cust_id='10000005';

删除数据

使用DELETE语句:

1、从表中删除特定的行;

2、从表中删除所有行;

DELETE FROM Customers
WHERE cust_id='10000006'

Search

    Post Directory