SHOW TABLES列出数据库中的表。
SHOW TABLES [LIKE '<像某某条件>' | WHERE <表达式>]
[ ]中的内容是可选的,|是或者,<>是中文解释,单引号''是字符串。语法说明:
LIKE:限制显示的行的语句。
WHERE:指定所选行必须满足的更一般条件的子句。
显示test数据库的数据表
mysql> use test; Database changed mysql> SHOW TABLES; +----------------+ | Tables_in_test | +----------------+ | b | | n2 | | newtable | | newtable_copy | +----------------+ 4 rows in set (0.00 sec)
使用like语句,找到以newt开头的数据表,%是通配符
mysql> SHOW TABLES like 'newt%'; +------------------------+ | Tables_in_test (newt%) | +------------------------+ | newtable | | newtable_copy | +------------------------+ 2 rows in set (0.00 sec)