From: | Tim Williams <williams(at)ugsolutions(dot)com> |
---|---|
To: | kheflin(at)shreve(dot)net (Kevin Heflin) |
Cc: | darold(at)neptune(dot)fr, pgsql-general(at)postgreSQL(dot)org |
Subject: | Re: [GENERAL] non-case sensitive searches |
Date: | 1999-01-13 10:12:10 |
Message-ID: | 199901131612.KAA24820@ug.eds.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
>
> On Wed, 13 Jan 1999, Gilles Darold wrote:
>
> > Hi Kevin,
> >
> > You can also use regexp expression like this :
> >
> > SELECT * FROM photos WHERE keywords ~* '.*$cat_name.*';
> >
> > it works fine.
>
>
> Thanks for the tip. Any recommendations as to which would be faster when
> searching about 2,000 records or so..
>
> WHERE keywords ~* '.*$cat_name.*';
>
> or
>
> WHERE lower(keywords) LIKE lower('%$cat_name%')
Well, you could (1) omit the second "lower()" function
(like '%cat_name%' is already in lower case!) (2) insure that your
table already contains nothing but lower-case (or upper-case) entries,
if appropriate.
- Tim
From | Date | Subject | |
---|---|---|---|
Next Message | Silvio Emanuel Barbosa de Macedo | 1999-01-13 10:40:52 | Re: Web-Based Reports (cgi using mod_perl) |
Previous Message | Stuart Rison | 1999-01-13 10:11:49 | [GENERAL] Tricky SQL query (tried [SQL]) |