----是这样么?
select *
from table_name t
inner join (select GID , c=max(Year),c1=max(Month) from table_name group by GID) t1
on t.GID=t1.GID and t.Year=t1.c and t.Month=t1.c1
select * from 表 a
where [Year]=(select max([Year]) from 表 where GID=a.GID)
and [Month]=(select max([Month]) from 表 where GID=a.GID and [Year]=a.[Year])