V. M. Brasseur wrote:
How about...
SELECT foo FROM bar WHERE LCASE(this) = "that";
Although there are always other ways to do it, of course.
Cheers,
--V
Schalk Neethling wrote:
If I search a field for 'doone' and one of the fields contains 'Lorna Doone' what is the best comparator to use as LIKE is skipping this one and I imagine '=' will do the same?
Case is not the problem. Unless the column or the match was declared BINARY, mysql is case insensitive. The problem is that LIKE must match the whole string. That is,
WHERE string_col LIKE 'doone'
is equivalent to
WHERE string_col = 'doone'
Either way, 'Doone', 'DOONE', 'doone', 'dOoNe', etc. would all match, but 'Lorna Doone', 'Doonesbury', and '211 Andoone Street' would not. If you want partial string matches, you need to either add wildcards to the LIKE comparison, or switch to RLIKE (REGEXP).
begins with doone contains doone ends with doone ----------------- -------------- --------------- LIKE 'doone%' '%doone%' '%doone' RLIKE '^doone' 'doone' 'doone$'
See the manual for details <http://dev.mysql.com/doc/mysql/en/String_comparison_functions.html> and <http://dev.mysql.com/doc/mysql/en/Regexp.html>.
Michael
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]