Re: [SQL] Re: [GENERAL] Determining if "in a text set" - Mailing list pgsql-sql

From Richi Plana
Subject Re: [SQL] Re: [GENERAL] Determining if "in a text set"
Date
Msg-id Pine.LNX.4.04.9903290306380.5417-100000@jaguar.mozcom.com
Whole thread Raw
In response to Re: [GENERAL] Determining if "in a text set"  (Richi Plana <richip@mozcom.com>)
List 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 by date:

Previous
From: Richi Plana
Date:
Subject: Re: [GENERAL] Determining if "in a text set"
Next
From: "Francois TETE"
Date:
Subject: inheritance and selection