Skip site navigation (1) Skip section navigation (2)

Re: Like problem

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Campbell, Lance" <lance(at)uiuc(dot)edu>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Like problem
Date: 2008-02-13 16:42:20
Message-ID: 47B31DEC.5050109@archonet.com (view raw or flat)
Thread:
Lists: pgsql-sql
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

In response to

Responses

pgsql-sql by date

Next:From: Tom LaneDate: 2008-02-13 16:52:41
Subject: Re: Like problem
Previous:From: Campbell, LanceDate: 2008-02-13 16:30:31
Subject: Like problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group