SELECT table_name FROM information_schema.tablesWHERE table_schema = 'tbs' AND table_name LIKE '%_lib' > 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= 'tbs' AND table_name LIKE '%_lib'' at line 4 > 时间: 0.273s
时间: 2023-12-26 13:06:03 浏览: 173
看起来是SQL语句出现了语法错误。请尝试使用以下SQL语句:
```
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'tbs' AND table_name LIKE '%\_lib';
```
在这个SQL语句中,我们使用了转义字符"\"来转义下划线"_",避免它被解释为SQL通配符。这应该可以解决上述错误。如果还有问题,请再告诉我。
相关问题
SELECT table_name FROM information_schema.tablesWHERE table_schema = 'tbs' AND table_name LIKE '%\_lib' > 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= 'tbs' AND table_name LIKE '%\_lib'' at line 1 > 时间: 0.076s
看起来还是有语法错误,错误提示指向了第1行。请尝试在FROM和WHERE之间添加一个空格,使用以下修正后的SQL语句:
```
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'tbs' AND table_name LIKE '%\_lib';
```
这个SQL语句应该可以正确地搜索所有后缀为"_lib"的表。如果还有问题,请让我知道。
阅读全文