MySQL SELECT Statement Case Sensitivity
By default, MySQL SELECT queries are not case sensitive. This means that if you have a table with a column named Value, and you run a query like the following:
SELECT * FROM `table` WHERE `Value` = "iaresavage"
...it will return all rows where the Value column exactly matches "iaresavage", regardless of whether the data is stored in lowercase, uppercase, or mixed case.
However, if you want to perform a case-sensitive comparison, you can use the BINARY operator. For example, the following query would only return rows where the Value column exactly matches "IAreSavage":
SELECT * FROM `table` WHERE BINARY `Value` = "IAreSavage"
It's important to note that using the BINARY operator can impact performance, so it's best to only use it when necessary.
The above is the detailed content of Is MySQL's SELECT Statement Case-Sensitive?. For more information, please follow other related articles on the PHP Chinese website!