Dynamically generate columns for crosstab in PostgreSQL

后端 未结 4 526
慢半拍i
慢半拍i 2020-11-27 05:12

I am trying to create crosstab queries in PostgreSQL such that it automatically generates the crosstab columns instead of hardcoding it. I have wri

4条回答
  •  一整个雨季
    2020-11-27 05:49

    The approach described here worked well for me. Instead of retrieving the pivot table directly. The easier approach is to let the function generate a SQL query string. Dynamically execute the resulting SQL query string on demand.

提交回复
热议问题