显示当前表的字段

show columns from login;   //显示当前表的字段
mysql> use MySQL_DATA    //首先选择数据库
Database changed
mysql> show columns from test;     //选择表
+-------+-------------+------+-----+---------+-------+
| Field | Type        | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| name  | varchar(20) | YES  |     | NULL    |       |
| age   | int(11)     | YES  |     | NULL    |       |
+-------+-------------+------+-----+---------+-------+
2 rows in set (0.02 sec)

mysql>

 

posted @ 2016-10-30 12:43  Xiao|Deng  阅读(312)  评论(0编辑  收藏  举报