Re: Fwd: TSQL To Postgres - Unpivot/Union All

From: Thomas Kellerer <shammat(at)gmx(dot)net>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Fwd: TSQL To Postgres - Unpivot/Union All
Date: 2023-07-20 15:07:31
Message-ID: bd9eab6e-7794-9b38-3958-a08d83d15709@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql


Anthony Apollis schrieb am 20.07.2023 um 14:17:
> Does not give me outputs for columns: Metric and Pricing Channel:
> image.png
>
> What am i doing wrong? Please assist?

UNPIVOT can be done using a LATERAL sub-query with a VALUES clause:

https://blog.sql-workbench.eu/post/unpivot-with-postgres/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2023-07-20 15:18:32 Re: My 1st JDBC and PostgreSQL
Previous Message Geoff Winkless 2023-07-20 14:51:35 Re: TSQL To Postgres - Unpivot/Union All

Browse pgsql-sql by date

  From Date Subject
Next Message Anthony Apollis 2023-07-20 15:47:08 Re: TSQL To Postgres - Unpivot/Union All
Previous Message Geoff Winkless 2023-07-20 14:51:35 Re: TSQL To Postgres - Unpivot/Union All