Re: WHERE 'Something%' LIKE ANY (array_field) - Mailing list pgsql-general

From Kevin Grittner
Subject Re: WHERE 'Something%' LIKE ANY (array_field)
Date
Msg-id 1376504630.5670.YahooMailNeo@web162904.mail.bf1.yahoo.com
Whole thread Raw
In response to Re: WHERE 'Something%' LIKE ANY (array_field)  (Tim Kane <tim.kane@gmail.com>)
Responses Re: WHERE 'Something%' LIKE ANY (array_field)  (Vishal <vishalvamrutiya@gmail.com>)
List pgsql-general
Tim Kane <tim.kane@gmail.com> wrote:

> I'm using a single LIKE clause against an array parameter, rather
> than multiple LIKE clauses against a single parameter.

The problem is that you have the arguments to the LIKE parameter
reversed with the attempts you show.  Try something like this:

select * from ids
  where exists
   (select * from (select unnest(ids.id)) x(id)
                     where x.id like 's45%');

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-general by date:

Previous
From: Richard Hipp
Date:
Subject: Seemingly inconsistent ORDER BY behavior
Next
From: Scott Marlowe
Date:
Subject: Re: Seemingly inconsistent ORDER BY behavior