Home > Database > Mysql Tutorial > body text

How to view field comments in mysql

王林
Release: 2020-10-13 14:40:11
Original
4665 people have browsed it

mysql查看字段的备注的方法:直接执行【show full columns from table.A;】语句即可查看表及字段的备注。

How to view field comments in mysql

1、单次查看表及字段备注

(推荐教程:mysql视频教程

show full columns from table.A;
Copy after login

2、查看整个数据库内查看数据库内所有的表名、表备注、字段名称、字段类型、字段备注

select 	t.TABLE_NAME
			,t.TABLE_COMMENT
			,c.COLUMN_NAME
			,c.COLUMN_TYPE
			,c.COLUMN_COMMENT 
from 
information_schema.`COLUMNS` c 
,information_schema.`TABLES` t 
where 	 c.TABLE_NAME = t.TABLE_NAME
and		 t.TABLE_SCHEMA = 'database'  --更换为自己查询的数据库名称
;
Copy after login

相关推荐:mysql教程

The above is the detailed content of How to view field comments in mysql. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template