MySQL DELETE命令用于從表中刪除行。它與WHERE子句一起使用。
語法
DELETE From Table_name WHERE Condition;
登錄后復制
示例
在下面的示例中,我們已經刪除了表格“employee”中id >= 100的行。
mysql> select * from employee; +------+--------+ | Id | name | +------+--------+ | 100 | Ram | | 200 | Gaurav | | 300 | MOHAN | +------+--------+ 3 rows in set (0.00 sec) mysql> delete from employee where id >=100; Query OK, 3 rows affected (0.06 sec) mysql> select * from employee; Empty set (0.00 sec)
登錄后復制
以上就是MySQL DELETE 命令的用途是什么?的詳細內容,更多請關注www.92cms.cn其它相關文章!