SQL: deleting tables with prefix

后端 未结 10 1395
后悔当初
后悔当初 2020-11-30 17:27

How to delete my tables who all have the prefix myprefix_?

Note: need to execute it in phpMyAdmin

10条回答
  •  Happy的楠姐
    2020-11-30 17:48

    You can do that in one command with MySQL:

    drop table myprefix_1, myprefix_2, myprefix_3;

    You'll probably have to build the table list dynamically in code though.

    An alternative approach would be to use the general purpose routine library for MySQL 5.

提交回复
热议问题