COLLATE case sensitive giving error (Unknown collation: 'Latin1_General_CS_AS')

时间:2017-11-02 15:41:17

标签: mysql sql collation

As the title says, I'm getting the following error when I run this sql:

SELECT PASS FROM STAFF WHERE PASS COLLATE Latin1_General_CS_AS = 'lucasL90';

Error:

Static analysis:
4 errors were found during analysis.
Unrecognized keyword. (near "COLLATE" at position 34)
Unexpected token. (near "Latin1_General_CS_AS" at position 42)
Unexpected token. (near "=" at position 63)
Unexpected token. (near "'lucasL90'" at position 65)
SQL query: Documentation
SELECT PASS FROM STAFF WHERE PASS COLLATE Latin1_General_CS_AS = 'lucasL90'

MySQL said: Documentation

#1273 - Unknown collation: 'Latin1_General_CS_AS'

2 个答案:

答案 0 :(得分:0)

使用

检查可用的排序规则
SHOW CHARACTER SET;

然后更新你的陈述:

SELECT PASS FROM STAFF WHERE PASS COLLATE <one of the above collations here>  = 'lucasL90'; 

答案 1 :(得分:0)

MySql的等效Sql Server Latin1_General_CS_ASlatin1_general_cs

因此,您可以按照以下方式更改查询:

SELECT PASS
FROM STAFF WHERE PASS COLLATE latin1_general_cs = 'lucasL90'