mysql - 查询数据库的表字段

1. 

-- mysql
select GROUP_CONCAT(column_name) from information_schema.columns where table_schema='数据库名' and TABLE_NAME = '表名'
GROUP BY table_name;
-- pg SELECT array_to_string(array_agg(a.attname),',') FROM pg_class as c,pg_attribute as a where c.relname = 'stock_quant' and a.attrelid = c.oid and a.attnum>0

 

posted @ 2021-12-24 17:28  10132714  阅读(237)  评论(0编辑  收藏  举报