MySQL26

删除记录

删除记录通过DELETE语句实现,其(单表删除)语法为:

DELETE FROM TABLE  [ WHERE WHERE_cONditiON ]

说明:
DELETE语句删除记录,并且返回被删除的行数(记录数);
如果省略WHERE条件,则删除全部记录;

-- 删除db02表中,姓名(name)是我吃西红柿的记录
DELETE FROM db02 WHERE name='我吃西红柿';
SELECT * FROM db02;
-- 删除db02表中,编号(id)是1号的记录
DELETE FROM db02 WHERE id=1;
SELECT * FROM db02;
-- 删除db02表中,全部数据
DELETE FROM db02;
SELECT * FROM db02;
上一篇:oracle wm_concat 函数无法使用的情况下,使用LISTAGG()函数


下一篇:c++ 函数内避免多次使用new 和 delete的用法