Re: [NOVICE] Trouble with IN operator - Mailing list pgsql-novice

From David G. Johnston
Subject Re: [NOVICE] Trouble with IN operator
Date
Msg-id CAKFQuwbOstKMKEZp6uF3F5MOrguz4EK7LjtNWFnBZNQqzvEf2Q@mail.gmail.com
Whole thread Raw
In response to [NOVICE] Trouble with IN operator  (Chuck Roberts <croberts@gilsongraphics.com>)
Responses Re: [NOVICE] Trouble with IN operator
List pgsql-novice
On Fri, Feb 3, 2017 at 10:12 AM, Chuck Roberts <croberts@gilsongraphics.com> wrote:

AND (TRIM(tbl.costcenter)  IN ('540'))

Can anyone shed some light on this for me?


​It works...

​WITH tbl (id, costcenter) AS ( VALUES (1, '500'), (2, '550') )
SELECT *
FROM tbl 
WHERE (trim(tbl.costcenter) IN ('550'));

So the problem resides in something you haven't show us - namely data.

David J.


pgsql-novice by date:

Previous
From: Chuck Roberts
Date:
Subject: [NOVICE] Trouble with IN operator
Next
From: Chuck Roberts
Date:
Subject: Re: [NOVICE] Trouble with IN operator