Re: Case Insensitive Queries - Mailing list pgsql-sql

From ANDREW PERRIN
Subject Re: Case Insensitive Queries
Date
Msg-id Pine.GSO.4.21L1.0105291233230.1461-100000@sunny
Whole thread Raw
In response to Case Insensitive Queries  (Mark <mark@zserve.com>)
List pgsql-sql
Try:

- The ILIKE operator, for example,

SELECT * FROM account WHERE username ILIKE "test";

- upper() or lower(), for example,

SELECT * FROM accont WHERE lower(username) = "test";

---------------------------------------------------------  Andrew J. Perrin - Assistant Professor of Sociology
Universityof North Carolina, Chapel Hill
 
269 Hamilton Hall CB#3210, Chapel Hill, NC 27599-3210 USA  andrew_perrin@unc.edu - http://www.unc.edu/~aperrin

On 29 May 2001, Mark wrote:

> Is it possible to execute a query using a where clause that allows case
> insensitive comparison between a field and text.
> 
> For example:
> 
> select * from account where username = 'test'
> 
> where username could be 'Test', which would be a match.  As is, this
> compare is case sensitive.
> 
> grep'd the source, but stricmp is only used for keywords and not actual
> column data.
> 
> Any help would be greatly appreciated.
> 
> Thanks,
> 
> Mark
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> 



pgsql-sql by date:

Previous
From: "Muhammed Yazici"
Date:
Subject: query on two databases ..
Next
From: Nils Zonneveld
Date:
Subject: Re: query on two databases ..