Home > Database > Mysql Tutorial > body text

MySQL通过字段注释查找字段名称

WBOY
Release: 2016-06-07 16:45:49
Original
1347 people have browsed it

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

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

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

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

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL

Ubuntu 14.04下搭建MySQL主从服务器

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb

MySQL-5.5.38通用二进制安装

--------------------------------------分割线 --------------------------------------

本文永久更新链接地址:

linux

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!