开发者

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

开发者 https://www.devze.com 2023-04-12 02:59 出处:网络
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\" in

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

精彩评论

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

关注公众号