适用于: Databricks SQL
 Databricks SQL  Databricks Runtime
 Databricks Runtime
返回表中的列的列表。 如果该表不存在,则会引发异常。
语法
SHOW COLUMNS { IN | FROM } table_name [ { IN | FROM } schema_name ]
注意
关键字 IN 和 FROM 可互换。
参数
- 
标识表。 名称不得包含 时态规范或选项规范。 
- 
使用架构名称限定 table_name的可选替代方式。 指定此参数后,不应使用其他架构名称来限定表名称。
示例
-- Create `customer` table in the `salessc` schema;
> USE SCHEMA salessc;
> CREATE TABLE customer(
    cust_cd INT,
    name VARCHAR(100),
    cust_addr STRING);
-- List the columns of `customer` table in current schema.
> SHOW COLUMNS IN customer;
  col_name
 ---------
   cust_cd
      name
 cust_addr
-- List the columns of `customer` table in `salessc` schema.
> SHOW COLUMNS IN salessc.customer;
  col_name
 ---------
   cust_cd
      name
 cust_addr
-- List the columns of `customer` table in `salesdb` schema
> SHOW COLUMNS IN customer IN salessc;
  col_name
 ---------
   cust_cd
      name
 cust_addr