how to search for exact string in mysql
问题 I'm trying to search for an exact match of a string in mysql. The string is 'nrew'. But when I do the queries below, I still get a result: SELECT UserID FROM sys_users WHERE UserID='NREW' SELECT UserID FROM sys_users WHERE UserID='NrEw' Please help. 回答1: SELECT UserID FROM sys_users WHERE BINARY UserID='NREW' 回答2: The default collation which MySQL uses to make comparisons is case insensitive. You need to specify a case sensitive collation or binary. You can either do this when creating the