`
anyue100
  • 浏览: 2814 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论
文章列表
今天上午看了下,花了会儿时间做的,测试已经通过; 按照先序遍历存储树和遍历树 东西放附件了
SELECT LICENSE_NAME,USER_GROUP_NAME, AVG(USAGE) AS USAGE, AVG(LICENSE_TOTAL) AS LICENSE_TOTAL,count(distinct CHECKOUTTIME) AS USERASKTIMES FROM FLEXLM_LICENSE_USAGE a LEFT JOIN user_group as b ON a.USER_NAME = b.USER_NAME and a.sampling_time = b.sampling_time WHERE a.sampling_time >='2013-03-01 00 ...
1.多where,少having where用来过滤行,having用来过滤组 2.多union all,少union union删除了重复的行,因此花费了一些时间 3.多Exists,少in Exists只检查存在性,性能比in强很多,有些朋友不会用Exists,就举个例子 例,想要得到有电话号码的人的基本信息,table2有冗余信息 select * from table1;--(id,name,age) select * from table2;--(id,phone) in: select * from table1 t1 where t1.id in (sele ...
Global site tag (gtag.js) - Google Analytics