mysql:不喜欢的正确语法是什么? [英] mysql: What is the right syntax for NOT LIKE?
本文介绍了mysql:不喜欢的正确语法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试显示名称不像mysql的模式的表会引发错误:
Hi I am trying to show tables with names not like a pattern by mysql is throws an error:
SHOW TABLES NOT LIKE "tree%";
返回:
#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
正确的语法是什么?
感谢阿尔曼.
推荐答案
您可以使用WHERE子句扩展,如下所示:
You could use the WHERE clause extension, as in:
SHOW TABLES WHERE `Tables_in_<DatabaseName>` NOT LIKE 'tree%';
MySQL≥5.0支持此功能.
This is supported on MySQL ≥5.0.
参考:
- 12.4.5.39. SHOW TABLES Syntax.
- 20.28. Extensions to SHOW Statements.
这篇关于mysql:不喜欢的正确语法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文