Home > Database > Mysql Tutorial > mysql通过字段注释查找字段名称_MySQL

mysql通过字段注释查找字段名称_MySQL

WBOY
Release: 2016-06-01 13:04:18
Original
1142 people have browsed it

有时候表的字段太多,只是大致记得表的注释,想通过字段注释查找字段名称,可以用如下语句:

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为数据库名。查询的效果图如下:

你也可以通过字段名称查找注释,通过以上语句。

=============查看表的字段个数:desc tj_record 语法是: desc 表名

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