我有一张user表,表里有个字段username
当存入一个带空格的西班牙语字符串时,查询就会有问题
比如AdgTécnico (最后有一个空格)
这时用select * from user where username = 'AdgTécnico'查不到记录
必须用select * from user where username = 'AdgTécnico '(加上空格)
但是如果不带西班牙语的字符,后面有没有空格都能查上来
请问各位 这是因为什么啊?
哦 版本是oracle11g
当存入一个带空格的西班牙语字符串时,查询就会有问题
比如AdgTécnico (最后有一个空格)
这时用select * from user where username = 'AdgTécnico'查不到记录
必须用select * from user where username = 'AdgTécnico '(加上空格)
但是如果不带西班牙语的字符,后面有没有空格都能查上来
请问各位 这是因为什么啊?
哦 版本是oracle11g
解决方案 »
- 数据量巨大的数据插入问题,请帮忙,谢谢!
- 事件日志文件已满
- 急!急!关于ORACLE的Managerment Server问题
- 请教OC4J安装的问题
- 问一个oracle数据类型转换的问题
- 再次呼叫::在使用rman恢复时,“无效日期”再次提问!!!
- 我想在INSERT之前先TRIM,(最好使用ORACLE的TRIM,而不是C函数)
- oracle9i for windows2000安装后,用sqlplus internal/oracle接上oracle,不知道用户名和密码?
- 高手请进,在编一个过程的时候遇到的问题
- 在线等待:请问:如何将ACCESS数据库中的一个表倒入到ORACLE8.17中????急!!!
- imp 出现非常特殊的错误!求助!
- 这里有人会DOS的没~ DOS那边没啥人啊`` 谁会写这语句的~
Connected as abc
SQL> create table abc (id1 varchar2(100),id2 char(100));
Table created
SQL> insert into abc values('abcdef ','abcdef ');
1 row inserted
SQL> commit;
Commit complete
SQL> select * from abc;
ID1 ID2
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
abcdef abcdef
SQL> select * from abc where id1='abcdef';
ID1 ID2
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
SQL> select * from abc where id1='abcdef ';
ID1 ID2
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
abcdef abcdef
SQL> select * from abc where id2='abcdef';
ID1 ID2
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
abcdef abcdef
SQL> select * from abc where id2='abcdef ';
ID1 ID2
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
abcdef abcdef
SQL>
你那条语句可以查出来结果回二楼
这个字段是VARCHAR2(64)类型我想知道的是为什么回出现这种情况呢?
不带西班牙语字符怎么就没问题呢?
不可能的吧 ,但是如果不带西班牙语的字符,后面有没有空格都能查上来 ,你说的
'ABC'和'ABC '肯定不一样