简体   繁体   English

显示表MySQL结果的别名

[英]Alias to Show Tables MySQL Result

When executing SHOW TABLES FROM your_db_name_here inside MySQL, the result has Tables_in_{your_db_name_here} as its indexes. 在MySQL中执行SHOW TABLES FROM your_db_name_here时 ,结果将Tables_in_ {your_db_name_here}作为索引。 I'd like to change that, like this: 我想改变它,像这样:

SHOW TABLES as _tables FROM mydb;

or something like 或类似的东西

SELECT Tables_in_mydb AS _tables FROM (SHOW TABLES FROM mydb);

Any ideas? 有任何想法吗?

It's usually easier to interact with the INFORMATION_SCHEMA database: INFORMATION_SCHEMA数据库交互通常更容易:

http://dev.mysql.com/doc/refman/5.0/en/tables-table.html http://dev.mysql.com/doc/refman/5.0/en/tables-table.html

Example: 例:

SELECT TABLE_NAME AS _tables 
FROM INFORMATION_SCHEMA.TABLES 
WHERE TABLE_SCHEMA = 'mydb'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM