开发者

SHOW FIELDS but with filter on field type?

I have a mySQL database with a number of tables with many fiel开发者_高级运维ds.

Is there a native way to find only the fields of the type TEXT?

I know how to do it using a scripting language like PHP. I just want to know whether there is a trick using SHOW TABLES/SHOW FIELDS I am not aware of.


For MySQL 5+ you can query INFORMATION_SCHEMA:

SELECT 
    TABLE_NAME, COLUMN_NAME
FROM 
    INFORMATION_SCHEMA.COLUMNS
WHERE 
    DATA_TYPE = 'TEXT';
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜