Dynamic column in SELECT statement postgres

后端 未结 6 1645
温柔的废话
温柔的废话 2020-12-20 14:55

I am quite new to the postgresql.

what is the best way to achieve this?

SELECT get_columns() 
  FROM table_name;

get_columns(

6条回答
  •  天命终不由人
    2020-12-20 15:56

    This is how you get the columnnames in a table:

    SELECT 
      column_name 
    FROM 
      information_schema.columns 
    WHERE 
      table_name = 'test';
    

提交回复
热议问题