How to delete multiple tables at a time? e.g like c* means all the tables starts with c have to be deleted at a time.

Showing Answers 1 - 15 of 15 Answers

dinu_26

  • Nov 12th, 2008
 

There is no possible way to delete the multiple tables in a single query. You need to delete the table one by one by using

<drop table> table name

  Was this answer useful?  Yes

As per my knowledge we cannot use Regular Expressions with drop stmt. You can delete multiple tables in a single statement by separating them with a comma.

Ex:
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| employee       |
| test           |
| test2          |
| test3          |
+----------------+
4 rows in set (0.01 sec)

mysql> drop table test,test2;
Query OK, 0 rows affected (0.08 sec)

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| employee       |
| test3          |
+----------------+
2 rows in set (0.00 sec)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions