Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 2005 在SQLServer2005中使用Macron_Sql Server 2005_Tsql - Fatal编程技术网

Sql server 2005 在SQLServer2005中使用Macron

Sql server 2005 在SQLServer2005中使用Macron,sql-server-2005,tsql,Sql Server 2005,Tsql,我有一个表,它的模式是 declare @tbl table(field varchar(20)) insert into @tbl select 'Pāo' union all select 'Paorum' union all select 'Some Pao' union all select 'Pao' 如果我只想在macron上搜索记录,我无法这样做 select * from @tbl where field = 'Pāo' 输出: field Pao Pao 如果我使用

我有一个表,它的模式是

declare @tbl table(field varchar(20))
insert into  @tbl 
select 'Pāo' union all select 'Paorum' union all select 'Some Pao'  union all select 'Pao'
如果我只想在macron上搜索记录,我无法这样做

select * from @tbl where field = 'Pāo'
输出:

field
Pao
Pao
如果我使用like运算符,例如(比如“%pāo%”),我将获得所有记录

我只对马克龙领域感兴趣

怎么做?在谷歌搜索之后,我甚至尝试过用nvarchar代替varchar,但没有任何改进

请帮忙


谢谢

您需要使用unicode:

declare @tbl table(field nvarchar(20))
insert into  @tbl 
select N'Pāo' union all 
select N'Paorum' union all 
select N'Some Pao' union all 
select N'Pao'

select * from @tbl where field = N'Pāo'

您需要使用unicode:

declare @tbl table(field nvarchar(20))
insert into  @tbl 
select N'Pāo' union all 
select N'Paorum' union all 
select N'Some Pao' union all 
select N'Pao'

select * from @tbl where field = N'Pāo'