List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:August 5 1999 11:03am
Subject:Re: case-sensitivity + small "bug"
View as plain text  
On Mi, 1999-08-04 09:56:35 -0500, Luke Meyer wrote:
> The default for string comparison in Mysql is case-insensitive -- a nice
> feature, but how do you turn it off?  :-)  I'd like to have a query like
> 
> SELECT Thingie FROM Thing WHERE Kind='a';
> 
> only actually select Things with a lowercase 'a' as Kind, not uppercase 'A'.
> Can someone please help?

Monty sometimes recommended the STRCMP() function, thus giving:
  SELECT Thingie FROM Thing WHERE STRCMP(Kind,'a')=0;

Or you could use the REGEXP (also know as RLIKE) operator:
  SELECT Thingie FROM Thing WHERE Kind REGEXP '^a$';

There's also the BINARY attribute others allready wrote about.

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
Thread
case-sensitivity + small "bug"Luke Meyer4 Aug
  • Re: case-sensitivity + small "bug"FRed4 Aug
  • Re: case-sensitivity + small "bug"Christian Mack4 Aug
  • Re: case-sensitivity + small "bug"Martin Ramsch5 Aug