Re: trying to pattern match to a value contained in a column - Mailing list pgsql-sql

From Ross J. Reedstrom
Subject Re: trying to pattern match to a value contained in a column
Date
Msg-id 20001207173224.A1909@rice.edu
Whole thread Raw
In response to Re: trying to pattern match to a value contained in a column  (Beth Gatewood <bethg@mbt.washington.edu>)
List pgsql-sql
Beth - 
Both errors you describe are due to using 6.3. The first one might work if
you parenthize the repeated use of ||, as so:

select * from av34s1 where chromat ~~ (('%' || sample ) || '%');

Ross

On Thu, Dec 07, 2000 at 01:45:00PM -0800, Beth Gatewood wrote:
> Hi Francis-
> 
> Thank you for your rapid and excellent response.
> 
> This makes perfect sense...unfortunately it isn't working...
> 
> 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 have also tried using LIKE....
> 
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005


pgsql-sql by date:

Previous
From: "Edmar Wiggers"
Date:
Subject: Unable to convert null timestamp to date. Bug?
Next
From: Tom Lane
Date:
Subject: Re: Unable to convert null timestamp to date. Bug?