Re: ignore single character in SELECT query?

From: Greg Stark <gsstark(at)mit(dot)edu>
To: jspring(at)gmail(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: ignore single character in SELECT query?
Date: 2005-04-13 04:56:08
Message-ID: 87oecjjmvr.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


jspring(at)gmail(dot)com writes:

> So basically I want to ignore a single character (the apostrophe
> character), anywhere in the middle of my search word, in selecting
> results. How can I do this?

WHERE replace(name,'''','') like '%dont%'

Beware of quoting issues if "dont" is coming from user supplied inputs.

--
greg

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Dinesh Pandey 2005-04-13 04:58:44 Re: ignore single character in SELECT query?
Previous Message Tom Lane 2005-04-13 04:46:37 Re: max question