我的查询是"select column_name,table_name from information_schema.columns"
。此查询返回许多列和表。现在,我想确定与返回的表名对应的数据库的名称。我该如何做到这一点?
答案 0 :(得分:2)
mysql> describe information_schema.columns;
+--------------------------+
| TABLE_CATALOG |
| TABLE_SCHEMA | <=== this one (schema == database)
| TABLE_NAME |
| COLUMN_NAME |
.......
答案 1 :(得分:1)
select database();
是吗?当前架构?