【发布时间】:2017-03-08 04:41:18
【问题描述】:
我想从每个具有table_schema='foo'(数据库名称)的表中show index。
mysql> show index from table_name from information_schema.tables where table_schema='foo';
ERROR 1109 (42S02): Unknown table 'table_name' in information_schema
从错误中,我看到查询将'table_name' 视为information_schema 中的一个表。如何重写查询以将'table_name' 视为information_schema.tables 中的列?
【问题讨论】:
-
我相信这就是你要找的东西:stackoverflow.com/questions/5213339/…
-
为什么你会认为
from table_name from是有效的语法?它甚至没有接近任何可以接受的东西。
标签: mysql information-schema database-indexes