以前一直写sql从来没做过优化,这次碰到了傻了,感觉没啥问题啊,但是人家说效率低,可以提高。
不知道怎么办,求助高手~
1.select a from table where b <> 'aaaa' (table without index)
2.select * from table where b like '%a%'
3.select name from person where birthday in (select birthday from table)
4.select * from table where a = 10
我就知道第二个应该用全文索引,第三个是不是用exist代替in啊
其他两个完全没概念,坐等高手指点~
不知道怎么办,求助高手~
1.select a from table where b <> 'aaaa' (table without index)
2.select * from table where b like '%a%'
3.select name from person where birthday in (select birthday from table)
4.select * from table where a = 10
我就知道第二个应该用全文索引,第三个是不是用exist代替in啊
其他两个完全没概念,坐等高手指点~
解决方案 »
- 请问这段代码错误点在哪。应该怎么改。
- 求助,这个sql语句在mssql可以通过,但在oracle却不能
- 请问在oracle数据库里处理生日提醒功能,该怎么做
- 求助一条模糊查询排序语句
- ORA-12519: TNS:no appropriate service handler found oracle报错,请高手解决。
- 关于某个索引未成功利用到的问题?
- 存储过程中的小问题,大虾帮个忙
- IW 和 WW 比较的疑惑
- 为什么PROC 编译出来的程序那么大 ?有8M 阿 ?有办法缩小字节吗 ?(源程序不大)
- oracle牛牛们救命啊!
- oracle 10G64位 32位client执行重复的问题
- 怎么把SQL SERVER的数据库进行数据迁移到ORACLE?
好像只有第三个可以改select name from person a where exists (select 1from table b where a.birthday = b.birthday )
2.select * from table where b like '%a%' select * from table where instr(b,-1,'a')
3.select name from person where birthday in (select birthday from table) select name from person a where exists (select 1from table b where a.birthday = b.birthday )4.select * from table where a = 10
----这个a是什么类型,如果是varchar2,就改为‘10’
我也不知道,1的原文是这样的,select 'not found' from userTable where memberid <> 'aaaa'
我感觉能动的地方也就是'not found' 和后面的不等于号了。
第一个就要看你其它的值是什么了,如果其它的值不多,可以写成 = '' or = '' or 这个方法,不用 不等于,然后再增加个索引,该给分啦