DELETE 語句用於刪除表中的行。
DELETE FROM 表名稱 WHERE 列名稱 = 值
LastName
FirstName
Address
City
Gates
Bill
Xuanwumen 10
Beijing
Wilson
Fred
Zhongshan 23
Nanjing
"Fred Wilson" 會被刪除:
DELETE FROM Person WHERE LastName = 'Wilson'
LastName
FirstName
Address
City
Gates
Bill
Xuanwumen 10
Beijing
可以在不刪除表的情況下刪除所有的行。這意味著表的結構、屬性和索引都是完整的:
DELETE FROM table_name
或者:
DELETE * FROM table_name