MySQL查询含转义字符反斜杠的时候一直为零查询无效

今天在查询一个字段时显示一直显示为0,可是表里明明有对应的数值。

select count(1) as vote_your_count from vote_beauty where beauty_person = '\u5c0f\u859b'

搜索了一会发现是转义字符的问题,换成如下即可。

select count(1) as vote_your_count from vote_beauty where beauty_person = '\\u5c0f\\u859b'

发表评论

您的电子邮箱地址不会被公开。