select t1.* from coal_installed_capacity t1
where NOT EXISTS
(select * from coal_installed_capacity t2 where t2.company_name = t1.company_name
and left(t2.data_time,6)=left(t1.data_time,6) and t2.data_time>t1.data_time
)
按照company_name , left(data_time,6) 分组, 按data_time排序,取排序第一条