Drop More than One Table at a Time: Quick Tip
dbadmin=> CREATE TABLE test1 (c INT); CREATE TABLE dbadmin=> DROP TABLE test1; DROP TABLEThat was easy. How about dropping more than one table?
dbadmin=> CREATE TABLE test2 (c1 INT, c2 VARCHAR); CREATE TABLE dbadmin=> CREATE TABLE test3 (c1 INT, c2 VARCHAR, c3 BOOLEAN); CREATE TABLE dbadmin=> CREATE TABLE test4 (c1 CHAR(1)); CREATE TABLEAt first you might be tempted to run a DROP TABLES command to drop multiple tables, but that won’t work.
dbadmin=> DROP TABLES test2, test3, test4; ERROR 4856: Syntax error at or near "TABLES" at character 6 LINE 1: DROP TABLES test2, test3, test4;It’s still the same simple DROP TABLE command:
dbadmin=> DROP TABLE test2, test3, test4; DROP TABLEHelpful Link: