更新时间:2023-02-15 17:32:33
The order and equality of characters is defined by the collation. In most cases, a case-insensitive collation is used.
If you need to use a strict, case-sensitive comparison for a specific datum, use the BINARY
operator:
mysql> SELECT 'a' = 'A';
-> 1
mysql> SELECT BINARY 'a' = 'A';
-> 0
mysql> SELECT 'a' = 'a ';
-> 1
mysql> SELECT BINARY 'a' = 'a ';
-> 0
所以在您的情况下:
SELECT g_path FROM glyphs WHERE BINARY g_glyph = :g_glyph ORDER BY rand()