56,912
社区成员




drop table if exists `t`;
create table `t`(
d datetime
);
insert into `t`(d)
select '2018-01-01'
union all select '2018-02-01'
union all select '2018-03-01'
union all select '2018-05-01'
union all select '2018-08-01'
union all select '2018-08-02'
union all select '2018-09-01'
union all select '2018-09-02'
union all select '2018-10-01'
union all select '2018-11-01';
select * from `t` where date_format(d, '%Y-%m')>=(
select min(d1) from (
select date_format(d, '%Y-%m') as d1
from `t`
group by date_format(d, '%Y-%m')
order by d1 desc
limit 0,6
) as tt
)
;