I was looking for the tables in my database not starting with "p_". MySQL doesn't let you execute this command:
show tables not like "p_%";
Which is odd considering it will allow "like" here:
show tables like "p_%";
Instead, you have to use the information schema like this:
SELECT table_name FROM information_schema.tables WHERE table_schema = 'mydb' AND table_name NOT LIKE 'p_%';
you can also use :
SHOW TABLES where tables_in_mydb not like 'p_%'
here 'mydb' is the name of your db.
Great post ;) !
thanks Manish!!, now, it works!!!
Thanks guys it helped alot
Post a Comment