Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id D731C2E0348 for ; Wed, 13 Feb 2008 12:42:25 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 47719-04 for ; Wed, 13 Feb 2008 12:42:21 -0400 (AST) Received: from fhw-relay07.plus.net (fhw-relay07.plus.net [212.159.14.215]) by postgresql.org (Postfix) with ESMTP id 224CC2E0369 for ; Wed, 13 Feb 2008 12:42:22 -0400 (AST) Received: from [84.51.143.99] (helo=server3.office.archonet.com) by fhw-relay07.plus.net with esmtp (Exim) id 1JPKge-0005xh-Ai; Wed, 13 Feb 2008 16:42:20 +0000 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 124D0274060; Wed, 13 Feb 2008 16:42:20 +0000 (GMT) Message-ID: <47B31DEC.5050109@archonet.com> Date: Wed, 13 Feb 2008 16:42:20 +0000 From: Richard Huxton User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: "Campbell, Lance" CC: pgsql-sql@postgresql.org Subject: Re: Like problem References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Plusnet-Relay: eef81821e66f56f39829f6c0e416935b X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/98 X-Sequence-Number: 30189 Campbell, Lance wrote: > 8.2.5 > > I am having an issue with trying to use 'LIKE' so that I can match on a > string with an underscore in it. What is the proper way to find the > following string? > WARNING: nonstandard use of escape in a string literal > > LINE 1: ...ct c1 from t1 where c1 like '%abc\_%'; Either indicate you are using an escaped string: LIKE E'%abc\_%' Or, change the escape character: LIKE '%abcQ_%' ESCAPE 'Q' -- Richard Huxton Archonet Ltd