点击(此处)折叠或打开
-
--在sal列上创建非唯一索引
-
scott@TESTDB11>create index idx_emp1_sal on emp1(sal);
-
-
Index created.
-
-
--查询年薪 > 20,000的员工的编号、姓名、薪水、年薪
-
--不走索引
- select empno, ename, sal, sal * 12 from emp1 where sal * 12 > 20000;

点击(此处)折叠或打开
-
--修改为等价的写法,走索引
- select empno, ename, sal, sal * 12 from emp1 where sal > 20000 / 12;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17013648/viewspace-1070753/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/17013648/viewspace-1070753/
257




被折叠的 条评论
为什么被折叠?



