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'

 

posted @ 2017-03-15 23:13  后除  阅读(2703)  评论(0编辑  收藏  举报