比如:
ID num1 num2 num3 date    
1 100 200 300     2011-08-01
2 200 300 200     2011-08-02           //我要的是每个记录的num1+num2+num3最大的那个date日期信息 
3 500 200 300     2011-08-03
4 200 500 200     2011-08-04   我怎么能select出来我这样 
select date,max(num1+num2+num3) from table where date between “2011-08-01” and “2011-08-31”发现确实能把max的最大算出来 但是date总是错的 是第一个2011-08-01 date没有和max级联具体该用什么语句   
谢谢各位 

解决方案 »

  1.   

    select data from table order by (num1 + num2 + num3) desc limit 1
      

  2.   

    select date from tt order by (num1 + num2 + num3) desc limit 1orselect date from tt a where not exists(select 1 from tt where  (a.num1 + a.num2 + a.num3)<(num1 + num2 + num3) )
      

  3.   

    select data (num1 + num2 + num3) as Summary from table order by (num1 + num2 + num3) desc limit 1or select date,max(num1+num2+num3)as Summary from table having (num1+num2+num3)=Summary and date between “2011-08-01” and “2011-08-31”
      

  4.   

    select * from table order by (num1 + num2 + num3) desc limit 1
      

  5.   

    select date 
    from table 
    order by (num1 + num2 + num3) desc 
    limit 1