| От | Tom Lane |
|---|---|
| Тема | Re: "like any" in reverse? |
| Дата | |
| Msg-id | 18453.1265951315@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | "like any" in reverse? ("Gauthier, Dave" <dave.gauthier@intel.com>) |
| Список | pgsql-general |
"Gauthier, Dave" <dave.gauthier@intel.com> writes:
> I want to find all records where any element of lst like 'j%'.
> This does not work...
> select * from foo where 'j%' like any(lst);
> Intuitively, you'd think....
> select * from foo where any(lst) like 'j%';
> ... but that's a syntax error.
Yeah, the ANY has to be on the right-hand side of the operator.
What you can do for this is build yourself a "reverse like"
operator, ie flip the left and right arguments within the function.
I'm pretty sure there are worked-out examples in the archives
if that's not enough of a hint for you.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера