Re: WHERE 'Something%' LIKE ANY (array_field)

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: WHERE 'Something%' LIKE ANY (array_field)
Дата
Msg-id 1376504630.5670.YahooMailNeo@web162904.mail.bf1.yahoo.com
обсуждение исходный текст
Ответ на Re: WHERE 'Something%' LIKE ANY (array_field)  (Tim Kane <tim.kane@gmail.com>)
Ответы Re: WHERE 'Something%' LIKE ANY (array_field)  (Vishal <vishalvamrutiya@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Richard Hipp
Дата:
Сообщение: Seemingly inconsistent ORDER BY behavior
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Seemingly inconsistent ORDER BY behavior