原文:mysql通过字段注释查找字段名称 有时候表的字段太多,只是大致记得表的注释,想通过字段注释查找字段名称,可以用如下语句: SELECT COLUMN_NAME,column_comment FROM INFORMATION_SCHEMA.Columns WHERE table_name='tj_record' AND table_schema='tianjin_20140811' AND column_comment LIKE '%数据是否有效%' 其中table_schema为数据库
语法: 创建表时的COMMENT内容,要查看这些内容,使用命令: show full fields from '表名称'; 查看tb_usr表字段注释: 创建新表的脚本中, 可在字段定义脚本中添加comment属性来添加注释: create table test( id int not null default 0 comment '用户id' ) 修改表的注释 alter table test1 comment '修改后的表的注释'; 修改字段的注释 alter table test1 mod
获取表: select table_name from user_tables; //当前用户拥有的表 select table_name from all_tables; //所有用户的表 select table_name from dba_tables; //包括系统表 select table_name from dba_tables where owner='用户名' user_tables: table_name,tablespace_name,last_analyzed等 dba_
转自:http://www.2cto.com/database/201202/119996.html 在MySQL下运行完下面这个建表语句后. 如何从数据字典中,检索出这个表的字段的相关信息? DROP TABLE IF EXISTS test_table; CREATE TABLE test_table( Test_ID int NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT '主键(自增长)', Test_Key varchar(10) NOT NUL