select filed1,BINARY(filed2) as filed2 from test_table where filed1="123";
当filed2字段中有中文字符时,需要使用BINARY关键字,否则查询出来的字段会是乱码。
另外,在where字句中,使用BINARY字段,会让查询区分大小写。
参考资料:
http://m.zhizuobiao.com/mysql/mysql-18081700284/
https://blog.csdn.net/xiangwang2016/article/details/102457469
http://c.biancheng.net/view/2428.html
https://blog.csdn.net/qq_39964694/article/details/82886671