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 千万级中快速插入和删除记录
3047浏览 • 1回复 待解决
mysql 历史数据如何迁移到 bak
5067浏览 • 1回复 待解决
Mysql数据如何打乱排序?
2231浏览 • 1回复 待解决
mysql 如何批量修改?
2661浏览 • 1回复 待解决
求一个sql语句,删除两张数据的?
2665浏览 • 2回复 待解决
sequelize;mysql关联查询的问题
3087浏览 • 1回复 待解决
怎样删除已添加的Module?
724浏览 • 1回复 待解决
分库分 MySQL 方案存在什么缺点?
3577浏览 • 2回复 待解决
RDS MySQL是否有锁的监控?
2944浏览 • 1回复 待解决
HarmonyOS 关系型数据批量插入数据
297浏览 • 1回复 待解决
HarmonyOS 关系型数据库如何批量update?
162浏览 • 1回复 待解决