使用 unicode 字符的 SQL LIKE 语句没有显示正确的结果 [英] SQL LIKE statement using using unicode characters does not show correct result

查看:34
本文介绍了使用 unicode 字符的 SQL LIKE 语句没有显示正确的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 SQL Server 2008 R2.我只是想知道为什么这个语句不能正常工作.

I'm using SQL Server 2008 R2. I'm just wondering why this statement doesn't work correctly.

例如:声明

WHERE CONTRACTORNAME LIKE '%á%' 

将为包含á"的每条记录提供正确的结果.但是声明

would gives me the correct result for every records containing "á". But the statement

WHERE CONTRACTORNAME LIKE '%ạ%' 

即使在 CONTRACTORNAME 列中有大量包含此字符的记录,也不会给出任何记录.有什么帮助吗?

would not gives any records even though in CONTRACTORNAME column have a tons of records containing this character. Any help?

推荐答案

尝试使用 Unicode 搜索字符串:

Try using a Unicode search string:

WHERE CONTRACTORNAME LIKE N'%ạ%' 

这篇关于使用 unicode 字符的 SQL LIKE 语句没有显示正确的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆