Re: [SQL] Subselects returning array and ANY...

2008-02-27 Thread Josh Berkus
Dawid, > But you are right, though! I just need to leave off the subselect! > Thanks! SELECT h.* FROM haystack h JOIN needles ON straw = ANY (straws); > > (not exactly what I was looking for, but it works ;)) Yeah, the problem with your first query is that it's returning a rowset of arrays, no

Re: [SQL] Subselects returning array and ANY...

2008-02-27 Thread Dawid Kuroczko
On Thu, Feb 28, 2008 at 1:11 AM, Josh Berkus <[EMAIL PROTECTED]> wrote: > Dawid, > >SELECT * FROM foo WHERE t = ANY (SELECT '{x4,5,zzz}'::text[]); > > ERROR: operator does not exist: text = text[] > > HINT: No operator matches the given name and argument type(s). You > > might need to add

Re: [SQL] Subselects returning array and ANY...

2008-02-27 Thread Josh Berkus
Dawid, >SELECT * FROM foo WHERE t = ANY (SELECT '{x4,5,zzz}'::text[]); > ERROR: operator does not exist: text = text[] > HINT: No operator matches the given name and argument type(s). You > might need to add explicit type casts. Drop the second SELECT, I think. postgres=# select 'x' = ANY