随笔分类 -  Oracle.hint

摘要:【需求】 某表原采用nvarchar2(2000)字段记录log,但随着时间增长2000长度不够用了,于是决定将其修改为clob字段。 【注意点】 原有数据不能一删了之,必须原封不动带入新字段。 【思路】 首先将原字段重命名成,再创建新字段,再将原有内容更新进去。 【SQL】 SQL> alter 阅读全文
posted @ 2022-05-18 19:29 逆火狂飙 阅读(249) 评论(0) 推荐(0) 编辑
摘要:本例适用的Oracle版本:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production 不保证在其它版本的Oracle上也是同样效果。 有一张雇员表含三个字段: create table emp( id i 阅读全文
posted @ 2021-09-17 21:27 逆火狂飙 阅读(144) 评论(0) 推荐(0) 编辑
摘要:select emp.*,dept.* from tb_emp03 emp,tb_dept03 dept where emp.deptno=dept.id -- 不加hint SQL> select emp.*,dept.* from tb_emp03 emp,tb_dept03 dept wher 阅读全文
posted @ 2020-01-28 17:08 逆火狂飙 阅读(181) 评论(0) 推荐(0) 编辑
摘要:索引全扫描的执行计划: SQL> select max(age) from tb_emp04 emp; 已用时间: 00: 00: 00.01 执行计划 Plan hash value: 2758779452 | Id | Operation | Name | Rows | Bytes | Cost 阅读全文
posted @ 2020-01-28 16:52 逆火狂飙 阅读(491) 评论(0) 推荐(0) 编辑
摘要:SQL> select /*+ leading(emp,dept) usenl(emp) */ emp.*,dept.* from tb_emp03 emp,tb_dept03 dept where emp.deptno=dept.id; 执行计划 Plan hash value: 96039728 阅读全文
posted @ 2020-01-28 04:26 逆火狂飙 阅读(278) 评论(0) 推荐(0) 编辑
摘要:select /*+ leading(s@a) use_nl(s@a,s */ stuid,courseid,score from score s where s.stuid in (select /*+ qb_name(a) */ stuid from student where stuname 阅读全文
posted @ 2020-01-04 16:37 逆火狂飙 阅读(319) 评论(0) 推荐(0) 编辑

生当作人杰 死亦为鬼雄 至今思项羽 不肯过江东
点击右上角即可分享
微信分享提示