SHOW COLUMNS
Shows only the column names for a single specified table or view. To obtain more detailed information, query the Amazon Glue Data Catalog instead. For information and examples, see the following sections of the Querying Amazon Glue Data Catalog topic:
-
To view column metadata such as data type, see Listing or searching columns for a specified table or view.
-
To view all columns for all tables in a specific database in
AwsDataCatalog
, see Listing or searching columns for a specified table or view. -
To view all columns for all tables in all databases in
AwsDataCatalog
, see Listing all columns for all tables. -
To view the columns that specific tables in a database have in common, see Listing the columns that specific tables have in common.
Synopsis
SHOW COLUMNS {FROM|IN} database_name.table_name
SHOW COLUMNS {FROM|IN} table_name [{FROM|IN} database_name]
The FROM
and IN
keywords can be used interchangeably. If
table_name
or database_name
has special characters like hyphens, surround the name with back quotes (for example,
`my-database`.`my-table`
). Do not surround the
table_name
or database_name
with single or double quotes. Currently, the use of LIKE
and pattern
matching expressions is not supported.
Examples
The following equivalent examples show the columns from the orders
table
in the customers
database. The first two examples assume that
customers
is the current database.
SHOW COLUMNS FROM orders
SHOW COLUMNS IN orders
SHOW COLUMNS FROM customers.orders
SHOW COLUMNS IN customers.orders
SHOW COLUMNS FROM orders FROM customers
SHOW COLUMNS IN orders IN customers