Re: Trouble with IN operator

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Chuck Roberts <croberts(at)gilsongraphics(dot)com>
Cc: PSql novice list <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Trouble with IN operator
Date: 2017-02-03 17:37:21
Message-ID: CAKFQuwbOstKMKEZp6uF3F5MOrguz4EK7LjtNWFnBZNQqzvEf2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, Feb 3, 2017 at 10:12 AM, Chuck Roberts <croberts(at)gilsongraphics(dot)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.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Chuck Roberts 2017-02-03 18:08:19 Re: Trouble with IN operator
Previous Message Chuck Roberts 2017-02-03 17:12:29 Trouble with IN operator