Re: TSQL To Postgres - Unpivot/Union All

David G. Johnston <david.g.johnston@gmail.com>

From: "David G. Johnston" <david.g.johnston@gmail.com>
To: Anthony Apollis <anthony.apollis@gmail.com>
Cc: "pgsql-general@lists.postgresql.org" <pgsql-general@lists.postgresql.org>
Date: 2023-07-20T12:48:22Z
Lists: pgsql-general
On Thursday, July 20, 2023, Anthony Apollis <anthony.apollis@gmail.com>
wrote:
>
>
> I am trying to convert this TSQL:
>

This doesn’t really seem relevant all that relevant at this point.  Given
some input data either the query produces the expected result or it doesn’t.


>
> What am i doing wrong? Please assist?
>


You need to provide more info - specifically the input data mentioned
above.  Try making a reproducer on this fiddle site.

 https://dbfiddle.uk/btGcOH30

David J.