Like problem - Mailing list pgsql-sql

From Campbell, Lance
Subject Like problem
Date
Msg-id B10E6810AC2A2F4EA7550D072CDE8760197EF2@SAB-FENWICK.sab.uiuc.edu
Whole thread Raw
Responses Re: Like problem
List pgsql-sql

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?

 

Table t1

Column c1

String I want to match on ‘abc_’

 

SELECT c1 FROM t1 WHERE c1 LIKE ‘%abc\_%’;

 

This gives me the following message:

 

WARNING:  nonstandard use of escape in a string literal

LINE 1: ...ct c1 from t1 where c1 like '%abc\_%';

 

Remember I want an actual underscore.

 

Lance Campbell

Project Manager/Software Architect

Web Services at Public Affairs

University of Illinois

217.333.0382

http://webservices.uiuc.edu

 

pgsql-sql by date:

Previous
From: "Bart Degryse"
Date:
Subject: return field from different table conditionally
Next
From: Richard Huxton
Date:
Subject: Re: Like problem