SHOW COLUMNS
適用対象: Databricks SQL
Databricks Runtime
table内のcolumnsのlistを返します。 table が存在しない場合は、例外が発生します。
構文
SHOW COLUMNS { IN | FROM } table_name [ { IN | FROM } schema_name ]
注意
キーワード IN
と FROM
は交換可能です。
Parameters
-
tableを識別します。 名前には、 時仕様またはオプション指定を含めてはなりません。
-
schema名で
table_name
を修飾するオプションの代替手段。 このパラメーターを指定した場合、table 名は別の schema 名で修飾しないでください。
例
-- 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