LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-14-2003, 10:03 AM   #1
icepig
LQ Newbie
 
Registered: Nov 2003
Location: New York
Posts: 20

Rep: Reputation: 0
mySQL LIKE search is case sensitive?


I'm using MySQL 3.23.57. A query with LIKE seems making case sensitive search:
select desc from rental where desc LIKE '%eat-in-kitchen%';

will not match "Eat-in-Kitchen". This is diff from the mysql tutorial.

Any idea on how to make a case insensitive search with pattern match?


Thanks
 
Old 11-14-2003, 12:21 PM   #2
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
Works fine for me in mysql 4


All I can think unless there's a difference in the versions is that the desc field as been defined with the BINARY attribute.
 
Old 11-14-2003, 01:39 PM   #3
icepig
LQ Newbie
 
Registered: Nov 2003
Location: New York
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks.

Also the query is made on BLOB field. Any way to get around it?
 
Old 11-14-2003, 03:29 PM   #4
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
BLOB's are case sensitive by default so, you could convert it to lower-case

select desc from rental where LOWER(desc) LIKE '%eat-in-kitchen%';

or upper if you prefer


select desc from rental where UPPER(desc) LIKE '%EAT-IN-KITCHEN%';


which should pull out variations of eat-in-kitchen
 
Old 11-14-2003, 04:29 PM   #5
icepig
LQ Newbie
 
Registered: Nov 2003
Location: New York
Posts: 20

Original Poster
Rep: Reputation: 0
That's a good point. Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
is it possible to make apache2 non-case sensitive snip128 Linux - Newbie 1 07-15-2005 05:00 PM
is apache case-sensitive? browny_amiga Linux - Software 2 06-21-2004 01:57 PM
Why is linux case sensitive? Jestrik Linux - General 9 12-16-2003 07:05 AM
case sensitive groupadd? sysmaster Linux - General 0 07-28-2003 04:53 AM
case-sensitive issue david_wliu Linux - General 4 03-06-2003 10:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration