0

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%'"); 
1

1 Answer 1

6
select table_name
from information_schema.tables
where table_name LIKE '%plan_2%'
and table_name NOT LIKE '%temp%'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.