13.7.7.5 show columns statement
show [extended] [full] {columns | fields}
{from | in} tb1_name
[from | in} db_name]
[like 'pattern'| where expr]
显示字段信息
show columns from mytable from mydb;
show columns from mydb.mytable;
这两种方式相等
- extended 展示隐藏字段
- full 包括 collation and comments
- extended 展示隐藏字段
- full 包括 collation and comments
- like 字段名匹配
- where select rows using more general conditions
displays values
- field
column name - type
data type - collation
字符集,if use full keyword - null
nullablity - key
index- if key is empty, either is not indexed or is indexed only as a secondary column in a mul, nonunique index
- if key is pri, it is primary key, or is one of mul primary key
- if key is uni, it is the first column of a unique index
- if key is mul, it is the first column of a nonunique index
key priority: pri uni mul
- default
default value - extra
nonempty in these cases:- auto_increment
- on update current_timestamp
- vitrtual generated or virtual stored
- default_generated
- privileges
only if you use full keyword - comment
use full keyword