Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qMT53-002TmW-71 for pgsql-general@arkaria.postgresql.org; Thu, 20 Jul 2023 12:48:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qMT50-0071XS-PD for pgsql-general@arkaria.postgresql.org; Thu, 20 Jul 2023 12:48:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qMT50-0071XJ-8V for pgsql-general@lists.postgresql.org; Thu, 20 Jul 2023 12:48:26 +0000 Received: from mail-oo1-xc2c.google.com ([2607:f8b0:4864:20::c2c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qMT4x-000VAs-Hw for pgsql-general@lists.postgresql.org; Thu, 20 Jul 2023 12:48:25 +0000 Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-55e1ae72dceso519763eaf.3 for ; Thu, 20 Jul 2023 05:48:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689857303; x=1690462103; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7N3VCL1iSCI/+2hsW/x0O484YkTEtLYCRoPCvIq+AUw=; b=EpV+KAy14hWmFkqMBvZO+0HOhTqj32RjCt6RH+0r/JHMu7Q8qX/iX6wPtwV2PlkSqs oYaKuRRFW6TwIic5AQ7JO7HioF5pLRjBx/5ScVtu7eAx1zl0qjIQHRR75mjTQchZ3pcJ 62YLGwz7Z7U5gRuVXeG+gDdU6TTmrEw4iE91I+ke9gMM1FmHVjth2ovSgTO2+tZQ+nsD mTmSO6hkIo3/l2t18EJ5PqqC/L3nb01PI/BD3gSjnZUYTBhnIqBGVNCYk6g5RGuhibFh ickzBXWhGzda/ylAR0RUUrk3tdm81UJGUh/tzJWn2S0sJuxb+fII/NoX/ILifClDAeu6 F5tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689857303; x=1690462103; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7N3VCL1iSCI/+2hsW/x0O484YkTEtLYCRoPCvIq+AUw=; b=d7HIvnrtCuFfiVZfbiHh0ov8k+LuLCd7AYCtVgTgIhX8M7BZtKjafi+ex2c7WokTPQ uEkHoOywISx4MBg/QSnVl3MBDaelkvZuGobwhOdixbAoJ1S0MxchVyMrMme1N2B2uhhD RRUIs2a74ytjahcHswz/QR313Zmazpjc4kvjTwHqCzxRWoOesqDqfcswz7UGpQZHsknE j02t2TKoLfjVXhW0c7iTHt41gkcSBlFviwKdzOgIpxhKaINsgof6ozIgzD/JAa3mjOF0 NyxOlQL9UVPeYP2lhn4HUhJBZ7nJS3lKpUMdYXXm/P2Qz/KH23y7t7PYTu6gZgN0hPmg qHjA== X-Gm-Message-State: ABy/qLak8JhYVLf4C3CeJWdGbHKPGZKvQlVGFa2L1OZdmCfFcdNzCnae FI2s6+MgSAESZmqi3jrArJf2ThrjJlG9Qe/CfNs= X-Google-Smtp-Source: APBJJlEXT+YoKIcJSnD0J/C0lZrB9QhcCSiS79Age4S/KUHE573SlGkP/xfIzSSgfKp1PFY8346UgLtSf+DgMG1L/1A= X-Received: by 2002:a4a:5894:0:b0:566:fa8f:7ac2 with SMTP id f142-20020a4a5894000000b00566fa8f7ac2mr2407274oob.4.1689857302696; Thu, 20 Jul 2023 05:48:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6358:3123:b0:ff:aecc:bb10 with HTTP; Thu, 20 Jul 2023 05:48:22 -0700 (PDT) In-Reply-To: References: From: "David G. Johnston" Date: Thu, 20 Jul 2023 05:48:22 -0700 Message-ID: Subject: Re: TSQL To Postgres - Unpivot/Union All To: Anthony Apollis Cc: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000003f994f0600ea903d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000003f994f0600ea903d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thursday, July 20, 2023, Anthony Apollis wrote: > > > I am trying to convert this TSQL: > This doesn=E2=80=99t really seem relevant all that relevant at this point. = Given some input data either the query produces the expected result or it doesn= =E2=80=99t. > > 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. --0000000000003f994f0600ea903d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thursday, July 20, 2023, Anthony Apollis <anthony.apollis@gmail.com> wrote:

I am trying to convert this TSQL:
= =C2=A0
This doesn=E2=80=99t really seem relevant all that relevan= t at this point.=C2=A0 Given some input data either the query produces the = expected result or it doesn=E2=80=99t.
=C2=A0

What am i doing wrong? Please assist?


You need to provide more = info - specifically the input data mentioned above.=C2=A0 Try making a repr= oducer on this fiddle site.


David J.
--0000000000003f994f0600ea903d--