tags:

views:

54

answers:

1

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 party_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.

+2  A: 

Try,and tell me the result

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

kupa
If I use trim with party_type, I can get the result.
Sailing