mysql删除表有三种方法:1、不再需要该表时, 用 drop;例如:drop table tb; drop 是直接将表格删除,无法找回。2、仍要保留该表,但要删除所有记录时, 用 truncate;例如:TRUNCATE TABLE user; 删除表中所有数据,但不能与where一起使用;3、要删除部分记录或者有可能会后悔的话, 用 dele...
mysql清除表数据
mysql删除表有三种方法:
1、不再需要该表时, 用 drop;
例如:drop table tb; drop 是直接将表格删除,无法找回。
2、仍要保留该表,但要删除所有记录时, 用 truncate;
例如:TRUNCATE TABLE user; 删除表中所有数据,但不能与where一起使用;
3、要删除部分记录或者有可能会后悔的话, 用 delete。
例如:delete from user; 删除user表所有数据
delete from user where username ='Tom'; 删除指定行。
2021-01-17