Re: drop table like
Hi,
You can use
show tables like 'tmp%';
+-----------------------+
| Tables_in_test (tmp%) |
+-----------------------+
| tmp1 |
| tmp2 |
| tmp3 |
+-----------------------+
AND
drop table tmp1, tmp2, tmp3;
---
I sometimes combine the two in a shell script. Be careful.
mysql -N -e "show tables like 'tmp%'" test | perl -e 'while(<>){chomp; push @tables, $_;}print "drop table " . join ("," ,@tables) . "\n";' | mysql test
Chris
Subject
Written By
Posted
Re: drop table like
June 08, 2005 01:59PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.