select a.*
from tb1 a join(
select 日期=max(日期) from tb1 group by convert(char(7),日期,120)
)b on a.日期=b.日期
from tb1 a join(
select 日期=max(日期) from tb1 group by convert(char(7),日期,120)
)b on a.日期=b.日期
from tb1 a join(
select id=min(id) from tb1 a join(
select 日期=max(日期) from tb1
group by convert(char(7),日期,120)
)b on a.日期=b.日期
group by b.日期
)b on a.id=b.id
from TB1
group by month(日期)