ITeye博客

MySQL查看表结构

finux · 2010-04-10 23:51 · SQL · 数据库 · Markdown

MySQL上面查看表结构的方式:

 

1. desc table_name; --describe table_name

 

2. show columns from table_name;

 

3. show create table table_name;

 

4.

use information_schema;

select * from columns where table_name = 'table_name';

 

--呵呵。。。不少吧,第1种最简单了,需要比较详细的信息选第3种或第4种比较合适~

评论(4)

  1. #4 楼 · weiyanqing · 2010-11-08 16:49

    一点都不好用 怎么回事

  2. #3 楼 · aodi · 2010-09-09 17:20

    挺好用的啊

  3. #2 楼 · finux · 2010-04-20 00:38

    cnSpirit writes:

    [align=center]哈哈,前三种我居然都知道啊! 我是不是太厉害了,3/4我都知道呢! 学习第四种。[/align]

    你太强了,呵呵~

  4. #1 楼 · cnSpirit · 2010-04-19 23:50

    哈哈,前三种我居然都知道啊! 我是不是太厉害了,3/4我都知道呢! 学习第四种。

评论功能维护中,当前仅展示历史评论。