Case sensitivity issue

Started by Nonameover 24 years ago6 messagesgeneral
Jump to latest
#1Noname
mike7411@earthlink.net

If I am doing a command such as

select * from Apples where color like '%red%';

how do I make it case insensitive?

Thanks.

mike

#2Szabo Zoltan
col@econet.hu
In reply to: Noname (#1)
Re: Case sensitivity issue

Use: ILIKE

Michael Gay wrote:

Show quoted text

If I am doing a command such as

select * from Apples where color like '%red%';

how do I make it case insensitive?

Thanks.

mike

#3Mitch Vincent
mvincent@cablespeed.com
In reply to: Noname (#1)
Re: Case sensitivity issue

SELECT * FROM apples WHERE lower(color) LIKE '%red%';

Make sure that what ever 'red' might be is always lower case (you can pass
it through lower() too, of course)..

-Mitch

----- Original Message -----
From: "Michael Gay" <mike7411@earthlink.net>
To: <pgsql-general@postgresql.org>
Sent: Monday, September 10, 2001 12:02 AM
Subject: [GENERAL] Case sensitivity issue

Show quoted text

If I am doing a command such as

select * from Apples where color like '%red%';

how do I make it case insensitive?

Thanks.

mike

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

#4Patrik Kudo
kudo@partitur.se
In reply to: Noname (#1)
Re: Case sensitivity issue

select * from Apples where lower(color) like '%red%';

ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
K�nns det oklart? Fr�ga p�!

On 9 Sep 2001, Michael Gay wrote:

Show quoted text

If I am doing a command such as

select * from Apples where color like '%red%';

how do I make it case insensitive?

Thanks.

mike

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

#5Jeff Eckermann
jeckermann@verio.net
In reply to: Noname (#1)
Re: Case sensitivity issue

use "ILIKE" instead of "LIKE"
or use a regular expression match: ~* 'red'

----- Original Message -----
From: "Michael Gay" <mike7411@earthlink.net>
To: <pgsql-general@postgresql.org>
Sent: Sunday, September 09, 2001 11:02 PM
Subject: [GENERAL] Case sensitivity issue

Show quoted text

If I am doing a command such as

select * from Apples where color like '%red%';

how do I make it case insensitive?

Thanks.

mike

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

#6Matthew Rice
matt@starnix.com
In reply to: Noname (#1)
Re: Case sensitivity issue

Szabo Zoltan <col@econet.hu> writes:

Use: ILIKE

If I am doing a command such as
select * from Apples where color like '%red%';
how do I make it case insensitive?

I was trying to solve a similar problem where I wanted an exact match to work
in PostgreSQL and MySQL and ended up with:

lower(Field) = lower('string')

Is there another way that works on both?
--
matthew rice <matt@starnix.com> starnix inc.
tollfree: 1-87-pro-linux thornhill, ontario, canada
http://www.starnix.com professional linux services & products