sql 问题,帮帮忙看一下
有col1 nvarchar(5),col2 nvarchar(20)两个字段
sqlserver的collation为Chinese_Taiwan_Stroke_CI_AS
其中都有数据‘hello'
我用
select * from table1 where col1='hello'能找到结果
但用
select * from table1 where col2='hello'却得不到结果
请问为什么,是不是和collation有关系
怎样解决呀
问题点数:20、回复次数:7Top
1 楼IronPromises(铁诺)回复于 2001-11-27 17:26:21 得分 5
select * from table1 where col2=N'hello'Top
2 楼liujianjun_(流星尔)回复于 2001-11-27 17:40:03 得分 0
to IronPromises:
这个n是用来干什么的 。Top
3 楼GodHack(勇敢的心)回复于 2001-11-27 17:43:55 得分 5
根据你提供的排序规则属于台湾的而且区分大小写,看看COL2里面的有没有'hello'有没有大小写
Top
4 楼GodHack(勇敢的心)回复于 2001-11-27 17:46:58 得分 5
N表明创建的是基于UNICODE的Top
5 楼seeit(木头)回复于 2001-11-27 22:12:43 得分 5
i think in your second sql
you should code like this
select * from table1 where col2 like "hello%"
i don't know nvarchar is unchanged lenth or not in sybase.
i use by sybase.Top
6 楼seeit(木头)回复于 2001-11-27 22:14:13 得分 0
sorry. last words have a little mistake.
i think in your second sql
you should code like this
select * from table1 where col2 like "hello%"
i don't know nvarchar is unchanged lenth or not in oracle.
i use by sybase. Top
7 楼netyao(笑一笑:-))回复于 2001-11-28 11:04:04 得分 0
我觉得seeit(木头) 说得对,有可能在其后其它的字符Top




