mysql怎样批量删除表数据?

delete FROM yoshop_awards_record
delete FROM yoshop_dealer_apply
delete FROM yoshop_dealer_capital
delete FROM yoshop_dealer_order
delete FROM yoshop_dealer_referee
delete FROM yoshop_dealer_user
delete FROM yoshop_dealer_withdraw
delete FROM yoshop_goods_sku
delete FROM yoshop_goods_spec_rel
delete FROM yoshop_order
delete FROM yoshop_order_address
delete FROM yoshop_order_goods
delete FROM yoshop_recharge_order
delete FROM yoshop_return_address
delete FROM yoshop_store_role
delete FROM yoshop_store_user
delete FROM yoshop_user
delete FROM yoshop_user_address
delete FROM yoshop_user_balance_log
delete FROM yoshop_user_grade_log

我放在navicat查询中,全选中执行提示错误。怎样才能批量删除呢?


mysql
sql
数据库
2023-04-03 13:05:19
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
莫名瞄一眼
2

同时执行多条SQL要用分号分割,例如:

delete FROM yoshop_awards_record;
delete FROM yoshop_dealer_apply;
delete FROM yoshop_dealer_capital;

如果是全表删除,改用​​truncate table 表名​​执行更快!

分享
微博
QQ
微信
回复
2023-04-03 14:12:44
相关问题
mysql 千万级中快速插入和删除记录
1180浏览 • 1回复 待解决
mysql 如何批量修改?
878浏览 • 1回复 待解决
mysql 历史数据如何迁移到 bak
2912浏览 • 1回复 待解决
Mysql数据如何打乱排序?
557浏览 • 1回复 待解决
django怎么解决批量创建用户问题?
2780浏览 • 1回复 待解决
Mysql如何用sql语句删除这样的内容?
251浏览 • 1回复 待解决
sequelize;mysql关联查询的问题
1190浏览 • 1回复 待解决