解决方案 »
- 怎么把图片,视频存储在数据库中?
- Oracle Database 11g(11.1.0.7.0)(第1版) perl.exe进程占用?
- proc只能去数据库以前的数据,不能取新建表中数据
- 在ORACLE中,如何通过一个日期参数得到当月的数据
- 用LIST建好的分区了,在给分区加索引时提示无效的表分区方法
- 调用存储过程时出错: 必须说明标识符
- 全面剖析Oracle数据库中的分区功能
- 这个存储过程应该怎么写?
- 购买一套正版ORACLE数据库服务器后,在程序中发布ORACLE中的若干文件是否合法?
- oracle 如何dinstinct两列数据 以及一个max函数的问题
- 求解决一条oracle 语句IN的问题
- 请教一个触发器的作用?
from (select distinct t1.id,
min(date_1) over(partition by id) as begin_month,
1 as begin_seq
from (select t.*,
rank() over(partition by id order by date_1) as seq
from c t
where t.number_1 > 10) t1) a,
(select distinct t1.id,
max(date_1) over(partition by id) as end_month,
max(seq) over(partition by id) as end_seq
from (select t.*,
rank() over(partition by id order by date_1) as seq
from c t
where t.number_1 > 10) t1) b where a.id = b.id
and b.end_seq >= 3
and b.end_seq <= 5
and months_between(to_date(b.end_month, 'yyyymm'),
to_date(a.begin_month, 'yyyymm')) =
b.end_seq - a.begin_seq;
至于月份的显示格式,如果一定要按LZ你的格式输出,你自己调整下咯。