Reputation: 556
I have 100 tables. Some of the tables contain table name as 'plan_2' and some of them 'temp'.
So how can I select tables only 'plan_2' not containing 'temp'.
My query not working.
$result=mysql_query("SHOW TABLES LIKE 'plan_2%' AND TABLES NOT LIKE '%temp%'");
Upvotes: 0
Views: 620
Reputation: 204924
select table_name
from information_schema.tables
where table_name LIKE '%plan_2%'
and table_name NOT LIKE '%temp%'
Upvotes: 6