开发者

How do I query which database has a table named aaa?

There're too many databases,

开发者_开发百科how can I query which database has a table named aaa to narrow the range to search for?


You should look at the INFORMATION_SCHEMA database for "meta" information such as which databases contain which schemata. For example, to find a list of databases that contain tables with the name aaa, run this query:

SELECT schema_name FROM INFORMATION_SCHEMA.TABLES WHERE table_name = "aaa"

For more information on the INFORMATION_SCHEMA, see the MySQL docs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜