"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