Re: selecting recs based on a tmp tbl vals that are wildcarded ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: selecting recs based on a tmp tbl vals that are wildcarded ?
Дата
Msg-id 15603.1231426981@sss.pgh.pa.us
обсуждение исходный текст
Ответ на selecting recs based on a tmp tbl vals that are wildcarded ?  ("Gauthier, Dave" <dave.gauthier@intel.com>)
Список pgsql-general
"Gauthier, Dave" <dave.gauthier@intel.com> writes:
> select * from footable where name in (select val from match_these)

> ... won't work because "in" implies equality.  I want something like...

> select * from footable where name like (select val from match_these)

What you need is

 select * from footable where name ~~ any (select val from match_these)

It would probably be clearer to write

 select * from footable where name like any (select val from match_these)

but the ANY syntax requires an operator name, so you have to write the
operator equivalent for LIKE.

            regards, tom lane

В списке pgsql-general по дате отправления: