--先找到档期
select * from hv_item_info a where a.report_begdate > '2016-07-28' and a.report_begdate < '2016-07-29';

--找轮次
select * from media_item_wheel_info a where a.item_id = 46088 and a.rule_id = 0215 order by a.begin_date;

--按键情况
select * from media_user_dial_info a where a.item_id = 46088 and a.item_wheel_id in ('74419');

--中奖人数
select * from media_prizerl_info a where a.item_id = 46088 and a.item_wheel_id in ('74419');

--开始前在线人数
select * from (
select t.callingnbr,
t.callednbr,
t.flag,
lead(t.flag, 1, null) over(partition by t.callingnbr, t.callednbr order by t.logdate) nextflag,
t.logdate,
lead(t.logdate, 1, null) over(partition by t.callingnbr, t.callednbr order by t.logdate)
from MEDIA_USER_ONLINE_OFFLINE_LOG t
where t.callednbr in ('12590484666', '12590484667')
and t.flag <> 'DD'
and t.logdate >= to_Date('20160728105000', 'yyyymmddhh24miss')
and t.logdate <= to_Date('20160728113739', 'yyyymmddhh24miss')) a
where a.flag = 'on' and nextflag is null;

--结束时的在线人数
select * from (
select t.callingnbr,
t.callednbr,
t.flag,
lead(t.flag, 1, null) over(partition by t.callingnbr, t.callednbr order by t.logdate) nextflag,
t.logdate,
lead(t.logdate, 1, null) over(partition by t.callingnbr, t.callednbr order by t.logdate)
from MEDIA_USER_ONLINE_OFFLINE_LOG t
where t.callednbr in ('12590484666', '12590484667')
and t.flag <> 'DD'
and t.logdate >= to_Date('20160728105000', 'yyyymmddhh24miss')
and t.logdate <= to_Date('20160728113749', 'yyyymmddhh24miss')) a
where a.flag = 'on' and nextflag is null;

最新文章

  1. .NET平台开源项目速览(18)C#平台JSON实体类生成器JSON C# Class Generator
  2. Android JNI总结
  3. PHP unset()函数销毁变量 但没有实现释放内存
  4. *HDU1053 哈夫曼编码
  5. AFNetworking之缓存篇
  6. WPF自动隐藏的消息框(鼠标放上去将一直显示,移开动画继续),提供normal和error两种边框。
  7. Windows Server 2012 Recycle Bin corrupted
  8. Struts2 实战(一)
  9. AndEngine
  10. 黑马程序员——经典C语言程序设计100例
  11. 第四篇、微信小程序-icon组件
  12. merge into sql优化
  13. C#微信开发之旅--自定义菜单
  14. Mac Zip命令
  15. Zabbix的LLD功能--Low-level discovery
  16. C# 还原SQL数据库(非存储过程方式)
  17. intent传对象
  18. Delphi用ADOquery主从表例子(转)
  19. [Python]获取子线程异常信息
  20. 爬虫抓包工具Charles设置

热门文章

  1. WIN7 OEM Nin1 地址
  2. 最短路模板(Dijkstra &amp; Dijkstra算法+堆优化 &amp; bellman_ford &amp; 单源最短路SPFA)
  3. 使用delphi+intraweb进行微信开发3—微信消息处理
  4. ./upload/source/class/class_core.php
  5. 在VS中添加lib的简单方法
  6. spring+ibatis整合
  7. js代码生成form,解决mvc的url参数过长问题
  8. 自增长主键Id的另类设计
  9. php 判断文件或目录是否存在
  10. WebViewJavascriptBridge详细使用(转载)