F ff_ff Unregistered / Unconfirmed GUEST, unregistred user! 2008-06-27 #1 city 月份 一级天数 <br>按城市分组,求一级天数最多的月份?
Y yanfeng1001 Unregistered / Unconfirmed GUEST, unregistred user! 2008-06-30 #2 select table.city, table.月份 from table inner join (select city as C,Max(一级天数) as MaxOfDays from table group by city) A on A.C=table.city,A.MaxOfDays=table.一级天数
select table.city, table.月份 from table inner join (select city as C,Max(一级天数) as MaxOfDays from table group by city) A on A.C=table.city,A.MaxOfDays=table.一级天数
F ftlifeng Unregistered / Unconfirmed GUEST, unregistred user! 2008-06-30 #3 同意楼上<br>也可以写成<br>select city,月份 from table a,(select city,max(一级天数) n from table group by city) as b<br>where a.city=b.city and a.一级天数=b.n
同意楼上<br>也可以写成<br>select city,月份 from table a,(select city,max(一级天数) n from table group by city) as b<br>where a.city=b.city and a.一级天数=b.n