解决方案 »
- oracle 安装问题
- Oracle性能和SQL性能比较
- 能否有朋友将11g系统自身的定时计划解释一下?
- 关于job broken的问题
- Asp+oracle数据库中用触发器实现了一列自增长,问题是如何在Insert的同时取得增长后的编号
- 急~~~~~~~寻求高手出山,用存储过程实现对两张结构相同\主键编号相同表进行比较,将比较后结果不同的字段及内容放在临时表中,并能显示出来.
- 初学者问题:SQL*PLUS WORKSHEET和oracle slq*plus这两个查询窗口有什么区别?
- (高分送上)关于Unix操作系统下Oracle的问题
- 在查询方面,存储过程和视图那一个更好?请高手提示?
- oracle中between..and..的非常容易错误的使用点:字符串,数字的区间比较
- oracle 截取字符串
- 请教一sql语句的写法
with
a as (select * from cfg_callerrule_info where rule_type=1),
b as (select * from cfg_callerrule_info where rule_type=2)
select nvl(a.policy_id,b.policy_id) policy_id,a.time_slice,a.threshold,b.time_slice,b.threshold,
(case when a.rule_type+b.rule_type=3 then 1 end)
from a full join b on a.policy_id=b.policy_id;
SELECT c1.policy_id,
c1.time_slice,
c1.threshold,
c2.time_slice,
c2.threshold,
CASE
WHEN (c1.relation IS NOT NULL) THEN
c1.relation
WHEN (c2.relation IS NOT NULL) THEN
c2.relation
ELSE
NULL
END
from cfg_callerrule_info c1, cfg_callerrule_info c2
where c1.policy_id = c2.policy_id
and c1.rule_type < c2.rule_type
union
select c1.policy_id,
c1.time_slice,
c1.threshold,
c2.time_slice,
c2.threshold,
c1.relatio
from cfg_callerrule_info t1
where t1.policy_id in (select t1.policy_id
from cfg_callerrule_info t1
where t1.rule_type in (1, 2)
group by t1.policy_id
having count(rule_type) < 2) t2