Re: [SQL] Re: [GENERAL] Determining if "in a text set"
От | Richi Plana |
---|---|
Тема | Re: [SQL] Re: [GENERAL] Determining if "in a text set" |
Дата | |
Msg-id | Pine.LNX.4.04.9903290306380.5417-100000@jaguar.mozcom.com обсуждение исходный текст |
Ответ на | Re: [GENERAL] Determining if "in a text set" (Richi Plana <richip@mozcom.com>) |
Список | pgsql-sql |
Hi, On Mon, 29 Mar 1999, Richi Plana wrote: |o| |o| SELECT * FROM {class} |o| |o| WHERE '{phrase}' ~ ' ' || ( rtrim( FieldN ) || '$' ) |o| |o| OR '{phrase}' ~ '^' || ( rtrim( FieldN ) || ' ' ) |o| |o| OR '{phrase}' ~ ' ' || ( rtrim( FieldN ) || ' ' ) |o| |o| OR '{phrase}' = rtrim( FieldN ); |o| |o| 3) When I try the concat strings operator (||), I get the following psql |o| error: |o| |o| ERROR: parser: syntax error at or near "||" My mistake. I didn't take into account hierarchy/precedence of operators. It seems string concatenation (||) has a higher order compared to the regex and LIKE operators. It should have been. SELECT * FROM {class} WHERE '{phrase}' ~ ('^' || TRIM(FieldN) ...' L L Richi Plana 8^) ,-,-. ,-,-. ,-,-. ,-,-. ,- LL LL Systems Administrator / / \ \ / / \ \ / / \ \ / / \ \ / / LLLLL Mosaic Communications, Inc. \ \ / / \ \ / / \ \ / / \ \ / / LLLLL mailto:richip@mozcom.com `-'-' `-'-' `-'-' `-'-' ------------------------------------------------------------------------ P G P Key available at http://www2.mozcom.com/~richip/richip.asc Tired of Spam? Join this CAUCE! http://www.cauce.org/
В списке pgsql-sql по дате отправления: