select up.UP_NAME as printName,count(1) as qty from riv_print_history_l phl  JOIN tab_user_profile up
on up.UP_USER_ID = phl.PHL_PRINT_USER_ID
where
phl.CREATE_TIME >= '2017-00-15 00:00:00' and phl.CREATE_TIME < '2017-09-21 00:00:00'
GROUP BY phl.PHL_PRINT_USER_ID; select
(select UP_NAME from tab_user_profile where UP_USER_ID = tab1.PHL_PRINT_USER_ID)
as printName,tab1.qty from
(select PHL_PRINT_USER_ID,count(1) as qty from riv_print_history_l
where CREATE_TIME >= '2017-00-15 00:00:00' and CREATE_TIME < '2017-09-21 01:00:00' GROUP BY PHL_PRINT_USER_ID)tab1;

tab_user_profile     116行

riv_print_history_l   640746行

select PHL_PRINT_USER_ID,count(1) as qty from riv_print_history_l
where CREATE_TIME >= '2017-00-15 00:00:00' and CREATE_TIME < '2017-09-21 01:00:00' GROUP BY PHL_PRINT_USER_ID
查出的结果只有3行

第一个用时10s,第二个用时0.6s

最新文章

  1. PIC32MZ tutorial -- 32-bit Timer
  2. JAVA学习&lt;六&gt;
  3. Codeforces Round #207 (Div. 2) A. Group of Students
  4. git branch分支管理用法总结
  5. LDAP协议介绍
  6. 警惕使用WebClient.DownloadFile(string uri,string filePath)方法
  7. oracle 12c 学习系列(1)–12c初体验
  8. hdfs格式化hadoop namenode -format错误
  9. eclipse安装checkstyle无法加载到preferences的问题
  10. css正三角倒三角
  11. Python 元组内置函数
  12. 【翻译】Ext JS最新技巧——2014-8-13
  13. 开源分布式数据库SequoiaDB在去哪儿网的实践
  14. 入门 Webpack,一篇就够了
  15. form组件
  16. ivew定制主题 less ^3.0 时报错 .bezierEasingMixin(); Inline JavaScript is not enabled. Is it set in your options?
  17. Dubbo和Spring Cloud微服务架构对比
  18. expect自动化工具
  19. Python3 tkinter基础 Canvas coords 移动直线,itemconfig 设置矩形的颜色, delete 删除一条直线
  20. 1.3用socketserver创建服务器

热门文章

  1. CSS实现简单无缝滚动
  2. HihoCoder1655 : 第K小最简真分数([Offer收割]编程练习赛39)(唯一分解+容斥定理+二分)(不错的数学题)
  3. 洛谷 1979 华容道——最短路+dp
  4. vijos:P1053Easy sssp(spfa判环)
  5. 2、R-reshape2-melt
  6. 《Java多线程编程核心技术》读后感(九)
  7. gSoap使用入门(2)----自定义接口头文件
  8. 微信小程序开发之带搜索记录的搜索框
  9. LIS与LCS的nlogn解法
  10. POJ - 1458 Common Subsequence DP最长公共子序列(LCS)