显示表MySQL结果的别名 [英] Alias to Show Tables MySQL Result
本文介绍了显示表MySQL结果的别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在MySQL内部执行 your_db_name_here 中的SHOW TABLES时,结果以 Tables_in_ {your_db_name_here} 作为索引.我想这样更改:
When executing SHOW TABLES FROM your_db_name_here inside MySQL, the result has Tables_in_{your_db_name_here} as its indexes. I'd like to change that, like this:
SHOW TABLES as _tables FROM mydb;
或类似的
SELECT Tables_in_mydb AS _tables FROM (SHOW TABLES FROM mydb);
有什么想法吗?
推荐答案
与INFORMATION_SCHEMA
数据库进行交互通常更容易:
It's usually easier to interact with the INFORMATION_SCHEMA
database:
http://dev.mysql.com/doc/refman/5.0/en/tables-table.html
示例:
SELECT TABLE_NAME AS _tables
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'mydb'
这篇关于显示表MySQL结果的别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文