1,新建表以及添加表和字段的注释.
   create table t_user(
        ID INT(19) primary key auto_increment  comment '主键',
        NAME VARCHAR(300) comment '姓名',
        CREATE_TIME date comment '创建时间'
    )comment  = '用户信息表';

2,修改表/字段的注释.
     alter table t_user comment  = '修改后的表注释信息(用户信息表)';
    alter table t_user modify column id int comment '主键ID';
   --注意:字段名和字段类型照写就行

3,查询数据库所有表的详细信息(包括表的注释).
use information_schema;
select * from TABLES where TABLE_SCHEMA='my_db';
--查询某一张表的
use information_schema;
select * from TABLES where TABLE_SCHEMA='my_db' and TABLE_NAME= 'auth_user';

4,查询一张表的详细信息(包括字段注释,字段名称,类型等).
use information_schema;
select * from information_schema.columns where table_schema ='my_db'  and table_name = 'auth_user';

注:还有一种方式:

show create table table_name;
use my_db;
show full columns from auth_user;

mysql查询表和字段的注释的更多相关文章

  1. Sql Server 2008和2000查询表的字段和注释

    -- SQL Server 2008 SELECT 表名 = d.name, 表说明 = case when a.colorder=1 then isnull(f.value,'') else '' ...

  2. MySql 查询表中字段的数据类型

    [1]MySQL中查询某表中字段的数据类型 (1)DESC 表名: (2)DESCRIBE 表名: (3)SHOW COLUMNS FROM 表名: 应用示例: DESC cfg_acct_free_ ...

  3. mysql 查询表的字段名称,字段类型

    select column_name,column_comment,data_type from information_schema.columns where table_name='查询表名称' ...

  4. phpcms v9 中get的mysql查询表某字段最大值数据,表某字段不重复数据

    直切正题 1.表tb中字段num最大的数据 {pc:get $sql="select * from tb where num=(select MAX(num) from tb)"} ...

  5. mysql 查询表的字段数目

    select column_name from information_schema.`COLUMNS` where TABLE_NAME ='tcm_head'

  6. MySql 查询表字段数

    MySql 查询表字段数 SELECT COUNT(*) FROM information_schema.columns WHERE table_schema='test_cases' AND tab ...

  7. Oracle、Mysql、SqlServer创建表和给表和字段加注释

    一.Oracle --创建表 create table test (      id varchar2(200) primary key not null,      sort number,     ...

  8. Mysql中用SQL增加、删除、修改(包括字段长度/注释/字段名)总结

    转: Mysql中用SQL增加.删除.修改(包括字段长度/注释/字段名)总结 2018年09月05日 10:14:37 桥Dopey 阅读数:1830   版权声明:本文为博主原创文章,未经博主允许不 ...

  9. MySQL 给已存在的数据表 增加字段和注释

    MySQL 给已存在的数据表 增加字段和注释 问题描述 在开发一个系统的过程中,经常会遇到随着系统服务功能的扩展,或者服务之间的关联,需要适当的修改原有的表结构,比如,增加一些必要的字段. 示例:在已 ...

随机推荐

  1. 工欲善其事 之 Web 前端调试工具格式化混淆过的 JS 代码

    工欲善其事 之 Web 前端调试工具格式化混淆过的 JS 代码 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用途-保持一致&q ...

  2. POJ 1384 Piggy-Bank(完全背包)

    Description Before ACM can do anything, a budget must be prepared and the necessary financial suppor ...

  3. PHP代码审计 -1.SQL注入总结

    0x01 背景          最近在学习PHP代码审计,这里做一个SQL注入总结,是对自己学习知识的总结,也是为自己学习的笔记,方便自己反复翻阅. 0x02 PHP代码审计-SQL注入 挖掘SQL ...

  4. SVN迁移及备份的方法【转】

    转自: http://spiritfrog.iteye.com/blog/448578 + http://magnet2008.iteye.com/blog/586578 备份策略 ========= ...

  5. Android储存

    Android储存一共5种方法 一: 手机内置,外部储存 1.获取本地存储 (Android的读写文件及权限设置) getFilesDir()   data/data/包名/File getCache ...

  6. Android的读写文件及权限设置

    drwx read write excute openFileOutput(name,drwx); 用系统api读取文件 设置文件生成的权限:    public static boolean sav ...

  7. 【CSS系列】图像映射

    <!DOCTYPE html > <html xmlns="http://www.w3.org/1999/xhtml"> <head> < ...

  8. JS-元素大小深入学习-offset、client、scroll等学习研究笔记

    一些属性和方法,在dom中没有规定如何确定页面中元素大小的情况下诞生... 1.偏移量(offset dimension) 测试代码: <!DOCTYPE html> <html&g ...

  9. poj1568 Find the Winning Move[极大极小搜索+alpha-beta剪枝]

    Find the Winning Move Time Limit: 3000MS   Memory Limit: 32768K Total Submissions: 1286   Accepted:  ...

  10. 2015.10.9js(页面坐标)

    关于js鼠标事件综合各大浏览器能获取到坐标的属性 1.page随滚动条变化(pageY会增加滚动条滚动的距离),兼容性:除IE6/7/8不支持外,其余浏览器均支持; 2.clientX/Y获取到的是触 ...