`

分组子查询

 
阅读更多
  select t1.m,t1.pid ,max(t1.rel_energy) - min(t1.rel_energy) aa
from (
(select substring(t.cur_date from 1 for 10) as m,t.rel_energy,t.pid
  from t_electric_detail_copy t)  ) t1
group by t1.m,t1.pid order by pid
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics