Fwd: garbage data back - Mailing list pgsql-general

From Brad White
Subject Fwd: garbage data back
Date
Msg-id CAA_1=91Aej78jB__tgpfwWB_j_g1LULj7Yx9wUPVA2DeJbZ5wQ@mail.gmail.com
Whole thread Raw
In response to garbage data back  (Brad White <b55white@gmail.com>)
Responses Re: garbage data back
Re: Fwd: garbage data back
List pgsql-general
LOL

Joke's on me.

Here's the relevant part of the view

SELECT ...
    "Order Items"."ID" AS "OrderItemID",
    ...
    (("Orders"."ID" || '-'::text) || "Order Items"."ID") AS "FileKey"

Wait, then why are the Item IDs different?

Here are the results again, with the FileKey field expanded a bit.
image.png

On Mon, Mar 6, 2023 at 2:23 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 3/6/23 12:17, Brad White wrote:
> I was doing a SELECT * FROM view WHERE field LIKE pattern
> and getting garbage data back.
>
> Turns out it is filtering on a different field.
>
> As you can see here, when attempting to filter on the FileKey, it is
> actually filtering on the Order Item ID field.
>
> select "FileKey", "OrderItemID" from "vw_rptInvc_Permits"
> where "FileKey" LIKE '%1317'
>
> image.png
> I'm stumped. Any guesses?


What is the view definition?

Is there a table named vw_rptInvc_Permits?

--
Adrian Klaver
adrian.klaver@aklaver.com

Attachment

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: garbage data back
Next
From: "David G. Johnston"
Date:
Subject: Re: garbage data back