Received: from thor.tht.net (thor.tht.net [209.47.145.4]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eB806sP12756 for ; Thu, 7 Dec 2000 19:06:54 -0500 (EST) (envelope-from reedstrm@rice.edu) Received: from wallace.ece.rice.edu (wallace.ece.rice.edu [128.42.12.154]) by thor.tht.net (8.9.3/8.9.3) with ESMTP id TAA98083 for ; Thu, 7 Dec 2000 19:32:26 GMT (envelope-from reedstrm@rice.edu) Received: by rice.edu via sendmail from stdin id (Debian Smail3.2.0.102) for pgsql-sql@postgresql.org; Thu, 7 Dec 2000 17:32:24 -0600 (CST) Date: Thu, 7 Dec 2000 17:32:24 -0600 From: "Ross J. Reedstrom" To: Beth Gatewood Cc: Francis Solomon , pgsql-sql@postgresql.org Subject: Re: trying to pattern match to a value contained in a column Message-ID: <20001207173224.A1909@rice.edu> Mail-Followup-To: Beth Gatewood , Francis Solomon , pgsql-sql@postgresql.org References: <3A3004DC.4FF7CB37@mbt.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: <3A3004DC.4FF7CB37@mbt.washington.edu>; from bethg@mbt.washington.edu on Thu, Dec 07, 2000 at 01:45:00PM -0800 X-Archive-Number: 200012/56 X-Sequence-Number: 387 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., NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005