oracle数据库中的查询语句中的记录中有[]号 请问一下,oracle数据库中的查询语句中的记录中有[]号,查询不出来怎么办?例如,select * from A1 where strname='a[1]';出来没有记录,其实是有的。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from A1 where strname='a\[1\]' ESCAPE '\'; select * from A1 where strname like '%a[1]%'看看,也许strname里包含空格,所以不能查询出来 datatype of strname is char not varchar in your db?should use select * from A1 where trim(strname)='a[1]'; 樓主的查詢條件有問題SQL> create table t1 (strname varchar(10));Table createdSQL> insert into t1 values ('a[1]');1 row insertedSQL> select * from t1;STRNAME----------a[1]SQL> select * from t1 where strname='a[1]';STRNAME----------a[1] select * from A1 where strname='a[1]';a[1]中间某个地方有空格?select * from A1 where replace(strname,' ','')='a[1]'; 如何判断一个字段的值是否包含在某个字符串中?? 急,实现KEY值的自增长 求教,SQL存储过程移植到——oracle存储过程。 可以把ORACLE中的数据文件修改名字吗? MSSQL 中 while @@fetch_status = 0 在Oracle中怎么写,谢谢。 toad中如何看一条查询语句的运行时间??谢谢大家 8.1.7字段大小写问题-再现等待!!!! 如何写oracle的存储过程 触发器问题,送分的 如何配置包的大小 Oracle中trigger的几个问题 请问大侠如何清空ORACLE数据库里面的数据??
看看,也许strname里包含空格,所以不能查询出来
select * from A1 where trim(strname)='a[1]';
----------
a[1]SQL> select * from t1 where strname='a[1]';STRNAME
----------
a[1]
a[1]中间某个地方有空格?
select * from A1 where replace(strname,' ','')='a[1]';