当前位置:Gxlcms > 数据库问题 > 记录一些sql,怕忘了

记录一些sql,怕忘了

时间:2021-07-01 10:21:17 帮助过:39人阅读

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真是一个,非常让人感到博大精深的东西。

 

记录一些sql,怕忘了

标签:version   日期   model   logs   div   group   lin   business   显示   

人气教程排行