Re: small and big letter in WHERE statement
| From: | Ulrik S. Kofod | Date: | Tue, 15 Jun 2004 05:47:49 +0000 |
| Subject: | Re: small and big letter in WHERE statement | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-188296@lists.php.net to get a copy of this message | ||
John Nichel sagde:
> QT wrote:
>> Dear Sirs,
>>
>> When I use where statement, I see that there is no meaning small and big
>> letter. Without looking small caps or big, result comes back. But I want to
>> match only small letters. How can I do that?
>>
>> Best REgards
>>
>
> Where statement for what? MySQL? If so, I don't think you can do it on
> the SQL end as WHERE is normally case-insensitive. You could use a
> regular expression while looping thru your result set.
>
> --
In MySQL you can use the binary() to select case sensitive.
example:
select field_1, count(*) from table where field_1 = 'test' group by binary(field_1);
could give a result looking like this:
test 5
tEst 1
tesT 1
Test 100
select field_1, count(*) from table where binary(field_1) = 'test' group by
binary(field_1);
would then only give
test 5