Re: trying to pattern match to a value contained in a column
В списке pgsql-sql по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: trying to pattern match to a value contained in a column |
| Дата | |
| Msg-id | 28352.976231914@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: trying to pattern match to a value contained in a column (Beth Gatewood <bethg@mbt.washington.edu>) |
| Ответы |
Re: trying to pattern match to a value contained in a column
|
| Список | pgsql-sql |
Beth Gatewood <bethg@mbt.washington.edu> writes:
> I hope this isn't because I am using 6.3 (yes...I know it is very very
> old but this is currently where the data is!)
> here is the query:
> select * from av34s1 where chromat ~~ ('%' || sample || '%');
> ERROR: parser: syntax error at or near "||"
I seem to recall that || (and most other operators) wasn't
considered associative by the grammar way back when.
Try a fully parenthesized expression:
select * from av34s1 where chromat ~~ (('%' || sample) || '%');
regards, tom lane
PS: And do think about updating soon, hmm?
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера