max(a1,a2,a3) t1
min(b1,b2,b3) t2
if t1>t2 return null
if t1<=t2 retrun t1至t2就是这个意思,至于语句自己写吧
min(b1,b2,b3) t2
if t1>t2 return null
if t1<=t2 retrun t1至t2就是这个意思,至于语句自己写吧
解决方案 »
- 如何生成数据库脚本
- 请问有介绍使用"PLSQL Developer"操作oracle 10g的书吗?
- 关于数据库分布式设计与应用讨论?和资料
- 表名为T_YYMM,其中YYMM是年月,共几十张表,我如何给这些表都增加一个字段?并更新改字段
- 请帮忙解释一下
- 要查询得到每组的max(或者min等其他聚合函数)值,并 且得到这个行的其他字段
- 关于student guide
- 装Oracle时的端口和监听端口的关系?
- 请教各位高手!!!很急!!!!!!!!!!!!!!!!!!!
- >>求oracle 9i的入门教材!!
- 用VB和Oracle开发的过程中,出现ORA-06513错误,请大家指教
- 查询某天的上一天的记录怎样在where语句里怎样写啊
SELECT (LEAST(B1,B2,B3) - GREATEST (A1, A2, A3))*24 into v_time FROM DUAL;
A later date is considered greater than an earlier one. For example, the date equivalent of '29-MAR-1997' is less than that of '05-JAN-1998' and '05-JAN-1998 1:35pm' is greater than '05-JAN-1998 10:09am'.
A1 date,
B1 date,
A2 date,
B2 date,
A3 date,
B3 date
) return number
as
v_h number;
v_a date;
v_b date;
begin
if A1>A2 then v_a:=A1; else v_a:=A2; end if;
if A3>v_a then v_a:=A3;end if;
if B1<B2 then v_b:=B1;else v_b:=B2;end if;
if B3<v_b then v_b:=B3;end if;
if v_a<v_b then return (v_b-v_a)*24;esle return null;end if;
end;
/