📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

SHOW COLUMNS



Shows information about the columns in a given table.

Syntax

SHOW [ FULL ] COLUMNS {FROM | IN} tbl_name [ {FROM | IN} db_name ] [ LIKE '<pattern>' | WHERE <expr> ]

When the optional keyword FULL is included, TiDB Cloud Lake will add the collation, privileges, and comment information for each column in the table to the result.

Examples

CREATE TABLE books ( price FLOAT Default 0.00, pub_time DATETIME Default '1900-01-01', author VARCHAR ); SHOW COLUMNS FROM books FROM default; Field |Type |Null|Default |Extra|Key| --------+---------+----+------------+-----+---+ author |VARCHAR |NO | | | | price |FLOAT |NO |0.00 | | | pub_time|TIMESTAMP|NO |'1900-01-01'| | | SHOW FULL COLUMNS FROM books; Field |Type |Null|Default |Extra|Key|Collation|Privileges|Comment| --------+---------+----+------------+-----+---+---------+----------+-------+ author |VARCHAR |NO | | | | | | | price |FLOAT |NO |0.00 | | | | | | pub_time|TIMESTAMP|NO |'1900-01-01'| | | | | | SHOW FULL COLUMNS FROM books LIKE 'a%' Field |Type |Null|Default|Extra|Key|Collation|Privileges|Comment| ------+-------+----+-------+-----+---+---------+----------+-------+ author|VARCHAR|NO | | | | | | |

Was this page helpful?