pg库拼接列名

select string_agg((column_name||’ as “‘||upper(column_name)||’”'), ‘,’)
from information_schema.columns
where table_schema=‘public’ and table_name=lower(‘tableName’)

你可能感兴趣的:(sql,postgresql)