首页 > 解决方案 > SQL to delete tables that begins with common prefix

问题描述

I am looking to write a SQL query/stored procedure which would delete tables within a DB that begin with a common prefix like "table".

However the names of the tables begin with the prefix following by a number and I do not want to delete them all, if I could append the table numbers to the prefix.

Thanks

标签: mysqlsqldatabase

解决方案


look at this: Get table names using SELECT statement in MySQL

you could join that table with constraints on the table prefix

hope that helps and have fun


推荐阅读