Like problem

From: "Campbell, Lance" <lance(at)uiuc(dot)edu>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Like problem
Date: 2008-02-13 16:30:31
Message-ID: B10E6810AC2A2F4EA7550D072CDE8760197EF2@SAB-FENWICK.sab.uiuc.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2008-02-13 16:42:20 Re: Like problem
Previous Message Bart Degryse 2008-02-13 10:54:14 return field from different table conditionally