如何从SQL获取列注释 [英] How to obtain column comments from SQL

查看:62
本文介绍了如何从SQL获取列注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

众所周知,在MySQL的列中可以添加注释。
现在我想知道如何通过PHP / MySQL获得此评论。
我正在网上搜索,但尚未找到任何解决方案。
你们对这个问题有什么想法/解决方案吗?

As you guys propably know, there's the possibility to add a comment to a column in MySQL. Now I was wondering how I could obtain this comment via PHP/MySQL. I was searching the web but I didn't find any solution yet. Do you guys have any idea/solution for this problem?

问候!

推荐答案

SELECT
    COLUMN_COMMENT
FROM
    INFORMATION_SCHEMA.COLUMNS
WHERE
    TABLE_SCHEMA = 'db-name' AND
    TABLE_NAME = 'table-name' AND
    COLUMN_NAME = 'column-name'

http://dev.mysql.com/doc /refman/5.0/en/columns-table.html

这篇关于如何从SQL获取列注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆