SQL _通配符不使用unicode前缀N.

时间:2014-10-24 06:44:07

标签: sql unicode wildcard

如果我没有添加unicode前缀' N'

_ wildcard有效,但如果我添加它则不起作用。

例如

这将返回正确的值

Select * From TableA where Column1 is like '1_0'

这不会返回任何意图

Select * From TableA where Column1 is like N'1_0'

我尝试使用SQL Server 2012,上面两种格式都行不通。我需要添加%的后缀才能使其正常工作:

Select * From TableA where Column1 is like '1_0%' 

Select * From TableA where Column1 is like N'1_0%'

但不是我想要的结果,因为它也将返回1000,10001。

1 个答案:

答案 0 :(得分:0)

有空间,我用Rtrim()会解决问题

相关问题