MySQL queries are not case-sensitive by default. Following is a simple query that is looking for 'value'
. However it will return 'VALUE'
, 'value'
, 'VaLuE'
, etc…
SELECT * FROM `table` WHERE `column` = 'value'
The good news is that if you need to make a case-sensitive query, it is very easy to do using the BINARY
operator, which forces a byte by byte comparison:
SELECT * FROM `table` WHERE BINARY `column` = 'value'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…