是否可以强制查询区分大小写?
我的声音是这样的:
"SELECT g_path FROM glyphs WHERE g_glyph = :g_glyph ORDER BY rand()"
如果 g_glyph = r,则结果可以是 R 或 r,这不是我所期望的。我正在寻找区分大小写的返回。
我用谷歌搜索了我的问题,我找到了这个解决方案:
/*Case-sensitive sort in descending order.
In this query, ProductName is sorted in
case-sensitive descending order.
*/
SELECT ProductID, ProductName, UnitsInStock
FROM products
ORDER BY BINARY ProductName DESC;
但是以下行根本不起作用:
"SELECT g_path FROM glyphs WHERE g_glyph = :g_glyph ORDER BY BINARY rand()"
有什么建议吗?
非常感谢您的帮助。