您的位置:首页 > 其它

经典语句

2016-03-18 00:00 169 查看
摘要: 查询数据库表的字段,类型和注释。

查询表的字段名,类型,注释语句

SELECT col.table_schema,col.table_name,col.column_name,col.data_type ,
col.character_maximum_length,col.numeric_precision,col.numeric_scale,
col.is_nullable,col.column_default,des.description
FROM information_schema.columns col LEFT JOIN sr_description des
ON (col.table_schema||'.'||col.table_name)::regclass = des.objoid
AND col.ordinal_position = des.objsubid
WHERE col.table_name = 'test2' and col.table_schema='test'
ORDER BY ordinal_position;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: