嗨,我试图显示名称不像mysql的模式的表格引发错误:
SHOW TABLES NOT LIKE "tree%";
Run Code Online (Sandbox Code Playgroud)
收益:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT LIKE "tree%"' at line 1
Run Code Online (Sandbox Code Playgroud)
什么是正确的语法?
谢谢阿曼.
ken*_*ytm 38
您可以使用WHERE子句扩展,如下所示:
SHOW TABLES WHERE `Tables_in_<DatabaseName>` NOT LIKE 'tree%';
Run Code Online (Sandbox Code Playgroud)
MySQL≥5.0支持此功能.
参考: