From: Tom Lane <tgl@sss.pgh.pa.us>
To: Beth Gatewood <bethg@mbt.washington.edu>
Cc: Francis Solomon <francis@stellison.co.uk>
Cc: pgsql-sql@postgresql.org
Subject: Re: trying to pattern match to a value contained in a column
Date: Thu, 07 Dec 2000 18:31:54 -0500
Message-ID: <28352.976231914@sss.pgh.pa.us> (raw)
In-Reply-To: <3A3004DC.4FF7CB37@mbt.washington.edu>
References: <NEBBIFFPELJMCJAODNPKIEKHCDAA.francis@stellison.co.uk>
<3A3004DC.4FF7CB37@mbt.washington.edu>
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?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, bethg@mbt.washington.edu, francis@stellison.co.uk
Subject: Re: trying to pattern match to a value contained in a column
In-Reply-To: <28352.976231914@sss.pgh.pa.us>
References: <NEBBIFFPELJMCJAODNPKIEKHCDAA.francis@stellison.co.uk> <3A3004DC.4FF7CB37@mbt.washington.edu> <28352.976231914@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox