Description
SHOW COLUMNS
is an SQL command used to view column information in a table. With this command, users can quickly obtain the column names and data types of a table.
Syntax
Parameter Description
schema_name
: Optional parameter, specifies the schema to which the table belongs. If omitted, the current schema is used by default.table_name
: Required parameter, specifies the name of the table whose column information needs to be viewed.
Examples
View column information of a table in the current schema
Frequently Asked Questions
Q1: How to view detailed information about a table (such as table structure)?
- Use the
DESCRIBE
orSHOW CREATE TABLE
command:
Q2: Does SHOW COLUMNS
support filtering conditions?
- Direct filtering is not supported, but it can be achieved by querying
INFORMATION_SCHEMA.COLUMNS
: