-8
SHOW TABLES NOT LIKE 'wp_2_%'

this sql query is not working for me

Mureinik
  • 297,002
  • 52
  • 306
  • 350
vipz
  • 5
  • 4

2 Answers2

3

You can't use not like directly in a show tables statement, but you could put it in a where clause:

SHOW TABLES WHERE tables_in_db NOT LIKE 'wp_2_%';
Mureinik
  • 297,002
  • 52
  • 306
  • 350
1

Yes, and it shouldn't work. SHOW TABLES simply does not allow using NOT like that.

http://dev.mysql.com/doc/refman/5.7/en/show-tables.html

Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367