Re: From CROSSTAB: One Column data with Two results columns - Mailing list pgsql-admin

From Andreas Wagner
Subject Re: From CROSSTAB: One Column data with Two results columns
Date
Msg-id c1724e227b02088dddacb6db20e9e7b083267786.camel@web.de
Whole thread Raw
In response to Re: From CROSSTAB: One Column data with Two results columns  (M Sarwar <sarwarmd02@outlook.com>)
Responses Re: From CROSSTAB: One Column data with Two results columns
List pgsql-admin
Hello Mr. Sarwar!

I'm not certain about first and last names in foreign countries, so my
apologies if it's your first name.

Am Montag, dem 15.04.2024 um 12:25 +0000 schrieb M Sarwar:
>
> Hello Andreas,
> Using a function, I am generating  CROSSTAB SQL and the number of
> columns will vary for each execution. With that, it is extremely
> difficult to use view on this task.


I'm still not sure whether I understand your question. You look for a
way to produce statements like

SELECT test1p1.data, test1p2.data, test1p3.data,
    f(test1p1.data), f(test1p2.data), f(test1p3.data)
FROM test1p1, test1p2, test1p3;

programmatically? ("f()" is a user-defined function deriving the left
values on the sample-picture to the right values.)

In case using multiple tables is new to you, have a look at the "JOIN"-
statement.

Regards,
Andreas Wagner



pgsql-admin by date:

Previous
From: M Sarwar
Date:
Subject: Re: From CROSSTAB: One Column data with Two results columns
Next
From: Laurenz Albe
Date:
Subject: Re: A good tool for PostgreSQL admin - PuttyGPT = Putty + ChatGPT