oracle查询结果不区分大小写,oracle输入的不区分大小写

项目有一个需求,根据输入的内容模糊查询(一般是带英文字母的查询),例如:数据库表中这列存放的数据都是Iif,无论用当用户输入iif还是IIF(不区分大小写),都能得到查询结果,那么SQL脚本的写法如下:

select * from formula where upper(Text) like upper('%iif%')

select * from formula  where Lower(Text) like Lower('%iif%')

select * from fromula where Lower(Text) like '%iif%'

(‘%xxx%’) like这样的话影响效率,所以建议用

Select * from formula  where lower(Text) like ‘%iif%’;

Select * from formula  where upper(Text) like upper(‘%iif%’)这两句话结果是一样的,

但是效率来说的话,select * from formula  where lower(Text) like ‘%iif%,这句话要快一些,

所以最后采用了,select * from formula  where lower(Text) like '%iif%';

posted @ 2013-04-20 10:20  用心玲听  阅读(954)  评论(0编辑  收藏  举报