Wednesday, July 25, 2012

Case sensitive comparison in MySQL

If you have a case insensitive collation set on your database and you want to do a quick case sensitive comparison of two fields in MySQL - you can simply type binary infront of the field name in your query.

select column1, column2
where binary column1 <> binary column2

No comments:

Post a Comment