Page 1 of 1

MYSQL search case sensativity

Posted: Tue May 28, 2002 6:06 am
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.

Posted: Tue May 28, 2002 7:11 am
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

Posted: Tue May 28, 2002 7:46 am
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...

Thanks

Posted: Tue May 28, 2002 9:22 am
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