数据库
首页 > 数据库> > mysql - 查询数据库的表字段

mysql - 查询数据库的表字段

作者:互联网

1. 

-- mysql
select column_name from information_schema.columns where table_schema='SH_ERP' and TABLE_NAME = 'stock_quant'
select * from information_schema.columns where table_schema='SH_ERP' and TABLE_NAME = 'stock_quant';

-- 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

 

标签:ERP,查询数据库,表字,quant,pg,mysql,stock,where,schema
来源: https://www.cnblogs.com/JackShi/p/15728294.html