Dropping tables with WHERE clause
am 18.01.2005 14:25:51 von Greg Quinn
------=_NextPart_000_0003_01C4FD71.FE8AFD70
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I would like to drop multiple tables depending on the tablename...
i.e
drop tables WHERE tablename LIKE '%mailbox_ms%'
How can I do something like this?
Thanks
------=_NextPart_000_0003_01C4FD71.FE8AFD70--
Re: Dropping tables with WHERE clause
am 18.01.2005 14:30:34 von Ignatius Reilly
you can't with SQL.
Instead list your tables with:
SHOW [FULL|OPEN] TABLES [FROM db_name] [LIKE 'pattern']
HTH
Ignatius
_________________________
----- Original Message -----
From: "Greg Quinn"
To:
Sent: 18 January 2005 14:25
Subject: Dropping tables with WHERE clause
I would like to drop multiple tables depending on the tablename...
i.e
drop tables WHERE tablename LIKE '%mailbox_ms%'
How can I do something like this?
Thanks
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
RE: Dropping tables with WHERE clause
am 19.01.2005 23:19:19 von jbonnett
You could then use the output of that query to generate a sequence of
DROP queries to remove the tables you don't want. You would need to do
that in a client program. If it's a one-off you could do it manually by
cutting/pasting/editing. If it needs to be done regularly you would need
to prepare a client program/script to do it.
John Bonnett
-----Original Message-----
From: Ignatius Reilly [mailto:ignatius.reilly@free.fr]=20
Sent: Wednesday, 19 January 2005 12:01 AM
To: Greg Quinn; win32@lists.mysql.com
Subject: Re: Dropping tables with WHERE clause
you can't with SQL.
Instead list your tables with:
SHOW [FULL|OPEN] TABLES [FROM db_name] [LIKE 'pattern']
HTH
Ignatius
_________________________
----- Original Message -----=20
From: "Greg Quinn"
To:
Sent: 18 January 2005 14:25
Subject: Dropping tables with WHERE clause
I would like to drop multiple tables depending on the tablename...
i.e
drop tables WHERE tablename LIKE '%mailbox_ms%'
How can I do something like this?
Thanks
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org