Re: sub-select

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Henrik Steffen" <steffen(at)city-map(dot)de>
Cc: "pgsql" <pgsql-general(at)postgresql(dot)org>
Subject: Re: sub-select
Date: 2003-05-15 13:03:22
Message-ID: 7764.1053003802@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Henrik Steffen" <steffen(at)city-map(dot)de> writes:
> select * from foo where bar like '0101%' and foobar='03997';
> works fine (1 result). HOWEVER:

> select * from foo where bar like '0101%' and foobar=ANY(SELECT
> '03997'::TEXT);
> does not work at all (no result)...

What's the datatype of foobar? I'm betting it's char(n), and
you're losing in the second case because of (lack of) trailing
spaces.

regards, tom lane

In response to

  • sub-select at 2003-05-15 08:01:49 from Henrik Steffen

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Henrik Steffen 2003-05-15 13:14:59 Re: sub-select
Previous Message Tapan Trivedi 2003-05-15 12:00:56 Query changes