您好,欢迎访问一九零五行业门户网

我们怎样才能像列出 MySQL 表的列一样列出 MySQL 视图的所有列呢?

我们知道视图是一种虚拟表,也是表的组合,因此我们可以使用相同的查询来列出 mysql 视图的所有列,就像我们可以列出列一样mysql 表的。换句话说,我们可以使用show full columns语句来获取mysql视图的结构。其语法如下 -
语法show full columns from view_name;
这里 view_name 是我们想要从中获取列列表的视图的名称。
示例假设我们想要获取名为“info”的视图的列列表,然后可以在以下查询的帮助下完成 -
mysql> show full columns from info\g*************************** 1. row *************************** field: id type: int(11) collation: null null: yes key: default: null extra:privileges: select,insert,update,references comment:*************************** 2. row *************************** field: name type: varchar(20) collation: latin1_swedish_ci null: yes key: default: null extra:privileges: select,insert,update,references comment:*************************** 3. row *************************** field: subject type: varchar(20) collation: latin1_swedish_ci null: yes key: default: null extra:privileges: select,insert,update,references comment:*************************** 4. row *************************** field: address type: varchar(20) collation: latin1_swedish_ci null: yes key: default: null extra:privileges: select,insert,update,references comment:4 rows in set (0.00 sec)
以上就是我们怎样才能像列出 mysql 表的列一样列出 mysql 视图的所有列呢?的详细内容。
其它类似信息

推荐信息