Drop multiple tables in one shot in MySQL Ask Question

Drop multiple tables in one shot in MySQL Ask Question

How to drop multiple tables from one single database at one command. something like,

> use test; 
> drop table a,b,c;

where a,b,c are the tables from database test.

ベストアンサー1

We can use the following syntax to drop multiple tables:

DROP TABLE IF EXISTS B,C,A;

This can be placed in the beginning of the script instead of individually dropping each table.

おすすめ記事