MYSQL search case sensativity

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
knmwt15000
Forum Newbie
Posts: 8
Joined: Thu Apr 25, 2002 9:51 am

MYSQL search case sensativity

Post by knmwt15000 »

Hi guys/gals,

When I try to do a search like

Code: Select all

select journal from journals where journal like "%jou%";
my database seems to be case sensative and only returns the %jou% and not %JOU%. it does not do this on all of my tables and on others it returns both jou and JOU entries

it should not do this does anyone have a clue how to fix it.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Some column types are case sensitive which might be one thing to look at.
http://www.mysql.com/doc/B/L/BLOB.html

Also if a column is declared as binary you will get a case sensitive search.
http://www.mysql.com/doc/C/a/Case_sensitivity.html

These are the only things that I could think of that would make a search case sensitive.

Hope it helps,
Mac
User avatar
enygma
Site Admin
Posts: 175
Joined: Fri Apr 19, 2002 8:29 am
Location: Dallas, Tx

Post by enygma »

you could always just do something like:

select journal from journals where upper(journal) like "%JOU%";

then, everything would be uppercase and you wouldn't have to worry about case-sensitive...
User avatar
knmwt15000
Forum Newbie
Posts: 8
Joined: Thu Apr 25, 2002 9:51 am

Thanks

Post by knmwt15000 »

cheers,

I have used the solution making all upper case for now but I intend to use the first reply to get to the bottom of this.

tHANKS AGAIn
Post Reply