열 표시
적용 대상: Databricks SQL 검사 예 Databricks Runtime
테이블의 열 목록을 반환합니다. 테이블이 없으면 예외가 throw됩니다.
구문
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