开发者

Retrieve Comments from tables and columns in a Mysql database

开发者 https://www.devze.com 2023-03-17 21:41 出处:网络
i have to build an application to manage an existing MySQL database. This database was created with MySQLworkbench and some useful comments were added to its tables and columns.

i have to build an application to manage an existing MySQL database. This database was created with MySQLworkbench and some useful comments were added to its tables and columns.

I think it would be great to somehow, query that comments and show them to the user to explain "what that field is". The problem is i don't know if its possible to retrieve that comments (they are only visible from the workbench).

EDIT:

in the MySQL existing database i have to work with there is 开发者_开发技巧no INFORMATION_SCHEMA table. I think is something usual to find it but in my model there is no :S


Try with:

 SELECT column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='table_name';


You can parse the output of

show create table `YOURTABLE`;
0

精彩评论

暂无评论...
验证码 换一张
取 消