mysql批量清除表数据的sql生成

【目的】

truncate table xxx;

希望把表名中包含sell的表,全部truncate了。

【操作】

利用sql语句,批量生成truncate的sql,然后一次性运行。

select distinct CONCAT(‘truncate table ’,table_name,',')from information_schema.`TABLES` where table_name like ‘%sell%’

【参考】

https://blog.csdn.net/stone723cool/article/details/137626558

posted @ 2024-08-26 13:41  hushuer  阅读(55)  评论(0)    收藏  举报