MySQL Forums
Forum List  »  Newbie

Re: Lower case queries
Posted by: Nick Roper
Date: May 01, 2005 12:41PM

Hi John,

Comparisons between literal strings are not case-sensitive.

If you want to only find records that contain lower-case instances of 'widgets', then use:

AND BINARY type LIKE '%widgets%'

or

AND type LIKE BINARY '%widgets%'

This will convert one of the strings to a binary representation, and forces a binary (case-sensitve) comparison.

You don't need to use the BINARY keyword for both. If either side of the comparison is binary, then both strings will be compared using their binary representation.

Hope this helps,

Nick

--
Nick Roper

Options: ReplyQuote


Subject
Written By
Posted
May 01, 2005 04:31AM
May 01, 2005 12:29PM
Re: Lower case queries
May 01, 2005 12:41PM
May 01, 2005 03:07PM
May 01, 2005 04:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.