From 001bb1424a30fc6c741400536975f8c91dc13d0a Mon Sep 17 00:00:00 2001 From: jasongao Date: Sun, 2 Sep 2018 21:35:32 +0800 Subject: [PATCH] docs: add sql syntax description 'SHOW COLUMNS FROM [DB.]TABLE' --- docs/radon_sql_support.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/radon_sql_support.md b/docs/radon_sql_support.md index 46ee41f2..b643b6e5 100644 --- a/docs/radon_sql_support.md +++ b/docs/radon_sql_support.md @@ -30,6 +30,7 @@ Contents * [SHOW ENGINES](#show-engines) * [SHOW DATABASES](#show-databases) * [SHOW TABLES](#show-tables) + * [SHOW COLUMNS](#show-columns) * [SHOW CREATE TABLE](#show-create-table) * [SHOW PROCESSLIST](#show-processlist) * [SHOW VARIABLES](#show-variables) @@ -658,6 +659,34 @@ mysql> SHOW TABLES; 2 rows in set (0.01 sec) ``` +### SHOW COLUMNS + +`Syntax` + +``` +SHOW COLUMNS FROM [db_name.]table_name +``` + +`Instructions` +* Get the column definitions of a table + +`Example: ` + +``` +mysql> CREATE TABLE T1(A INT, B VARCHAR(10)) PARTITION BY HASH(A); +Query OK, 0 rows affected (0.52 sec) + +mysql> SHOW COLUMNS FROM T1; ++-------+-------------+------+-----+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-------+-------------+------+-----+---------+-------+ +| A | int(11) | YES | | NULL | | +| B | varchar(10) | YES | | NULL | | ++-------+-------------+------+-----+---------+-------+ +2 rows in set (0.01 sec) + +``` + ### SHOW CREATE TABLE `Syntax`