记录一些sql,怕忘了

SELECT business_line,count(*) FROM zc_db.t_bug group by business_line;

这个是展示的,显示某一项一共有多少个xxx,注意是group by

 

select DISTINCT `status` from t_bug WHERE create_time BETWEEN '2017-06-13 16:00:00' and '2017-06-15 23:59:00'

这个是看这一段日期内的问题的存在的所有状态。

 

select t_bug.id,t_bug.channel ,bug_type,`desc`,step_to_string,model,version,t_device.platform,network
from t_bug join t_detail on t_bug.id = t_detail.bug_id join t_device on t_bug.id = t_device.bug_id
where t_bug.id = t_bug.repeat_id and t_bug.id in(
  select bug_id from t_level where `type` = 'P3') and t_bug.create_time between '2017-06-13 16:00:00' and '2017-06-15 23:59:00'

这个就很骚,并且没有用表的缩写,比较长。

 

 

感觉sql真是一个,非常让人感到博大精深的东西。

 

posted @ 2017-07-11 19:04  wzb的QQ空间  阅读(262)  评论(0编辑  收藏  举报