Re: [SQL] Doing case-insensitive queries.

From: The Hermit Hacker <scrappy(at)hub(dot)org>
To: "Dana M(dot) Epp" <eppdm(at)netmaster(dot)ca>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Doing case-insensitive queries.
Date: 1998-05-26 17:34:33
Message-ID: Pine.BSF.3.96.980526133401.19802j-100000@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, 26 May 1998, Dana M. Epp wrote:

> I am trying to query a database case-insenstively on a char() field, and
> failing miserably. Could anyone direct me to some documentation that
> properly explains how to accomplish such a task in PostgreSQL.
>
> Items like ~* don't work when using the LIKE for me.
>
> Here is my current code segment on how I am doing this query with case
> sensitivity.
>
>
> $qstring = "select * from $database where vendor LIKE
> \'\%$inqstring\%\' ; ";
>
> $result = $con->exec($qstring);
>
> Can anyone tell me how I could query that without case-sensitivity?

select * from $database where vendor *~ '$inqstring';

I might have that *~ backwards...if that fails, try ~* :(

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christian Guenther 1998-05-26 18:49:19 how to compile and use soundex
Previous Message Dana M. Epp 1998-05-26 17:24:34 Doing case-insensitive queries.