DESCRIBE MATERIALIZED VIEW

描述物化视图中的列。

DESCRIBE 可以缩写为 DESC。

另请参阅:

CREATE MATERIALIZED VIEWDROP MATERIALIZED VIEWALTER MATERIALIZED VIEWSHOW MATERIALIZED VIEWS

语法

DESC[RIBE] MATERIALIZED VIEW <name>
Copy

参数

name

指定要描述的物化视图的标识符。如果标识符包含空格或特殊字符,则整个字符串必须放在双引号内。放在双引号内的标识符也区分大小写。

使用说明

  • 命令输出不包括视图定义。若要查看物化视图的定义,请使用 SHOW MATERIALIZED VIEWSGET_DDL

  • DESC MATERIALIZED VIEW 和 DESCRIBE TABLE 可互换。任一命令检索与语句中的条件匹配的表或视图的详细信息。

  • To post-process the output of this command, you can use the pipe operator (->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.

    The output column names for this command are generated in lowercase. If you consume a result set from this command with the pipe operator or the RESULT_SCAN function, use double-quoted identifiers for the column names in the query to ensure that they match the column names in the output that was scanned. For example, if the name of an output column is type, then specify "type" for the identifier.

示例

示例设置:

CREATE MATERIALIZED VIEW emp_view
    AS
    SELECT id "Employee Number", lname "Last Name", location "Home Base" FROM emp;
Copy

描述物化视图:

DESC MATERIALIZED VIEW emp_view;
Copy
+-----------------+--------------+--------+-------+---------+-------------+------------+-------+------------+---------+
| name            | type         | kind   | null? | default | primary key | unique key | check | expression | comment |
|-----------------+--------------+--------+-------+---------+-------------+------------+-------+------------+---------|
| Employee Number | NUMBER(38,0) | COLUMN | Y     | NULL    | N           | N          | NULL  | NULL       | NULL    |
| Last Name       | VARCHAR(50)  | COLUMN | Y     | NULL    | N           | N          | NULL  | NULL       | NULL    |
| Home Base       | VARCHAR(100) | COLUMN | Y     | NULL    | N           | N          | NULL  | NULL       | NULL    |
+-----------------+--------------+--------+-------+---------+-------------+------------+-------+------------+---------+
语言: 中文