Re: crosstab - Mailing list pgsql-general

From David G. Johnston
Subject Re: crosstab
Date
Msg-id CAKFQuwZJ8yoGMRvVGG1zkVLqGn1Kw9GHTGsDJdgwD_X6=ypyPQ@mail.gmail.com
Whole thread Raw
In response to crosstab  ("Rosebrock, Uwe (Environment, Hobart)" <Uwe.Rosebrock@csiro.au>)
List pgsql-general


On Wednesday, March 8, 2023, Rosebrock, Uwe (Environment, Hobart) <Uwe.Rosebrock@csiro.au> wrote:

Hi List

I like to use crosstab to pivot a long list of rows into columns, however the column labels are created dynamically with the resulting column type known.

 

Is there a way pass a list of names and types to crosstab (‘query’) as (<‘type list as strings in array’> ) ?

In other words,

Can I pass an array to crosstab row labels


No, you cannot change query structure at execution time in SQL.

David J. 

pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: public schema grants to PUBLIC role
Next
From: Алексей Ефимов
Date:
Subject: find coumn name and his type with greatest size in bytes