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

2023年 8月 26日 61.6k 0

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

语法

SHOW FULL COLUMNS FROM View_name;

登录后复制

这里 view_name 是我们想要从中获取列列表的视图的名称。

示例

假设我们想要获取名为“Info”的视图的列列表,然后可以在以下查询的帮助下完成 -

mysql> SHOW FULL COLUMNS FROM INFOG
*************************** 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 视图的所有列呢?的详细内容,更多请关注每日运维网(www.mryunwei.com)其它相关文章!

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论