开发者

NVARCHAR2 equation issue in Oracle 10g

Env:

Oracle version: Release 10.2.0.1.0 Server: Windows XP

Language in oracle:

select userenv('language') from dual;

Result:

CHINESE_CHINA.AL32UTF8

Table structure:

PARTY_ID NVARCHAR2(50)

PARTY_TYPE NVARCHAR2(50)

Data in the table:

PARTY_ID | PARTY_TYPE
---------+-----------
BEST     | C    
WILL     | C

SQL1:

SELECT  * FROM cc_party  
WHERE pa开发者_StackOverflow中文版rty_type = 'C'

Result:

nothing

SQL1:

SELECT  * FROM cc_party  
WHERE party_type = 'C' or party_type = 'C'

Result:

PARTY_ID | PARTY_TYPE
---------+-----------
BEST     | C    
WILL     | C

Question:

Why I can not select data by party_type = 'C' (SQL1) ? Is there some special things about NVARCHAR2 ?

If I update the where clause to party_type = 'C' or party_type = 'C' (SQL2), I can get the result. It makes me confused. I want to know why the result come out when I added or clause.


Try,and tell me the result

SELECT * FROM cc_party WHERE trim(party_type) = 'C'

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜