select max(field),a,b from yourtable group by a,b having 条件

解决方案 »

  1.   

    select max(filed) from table group by name
      

  2.   

    用GROUP BY和MAX(Filed)不就可以嘛
      

  3.   

    select Top 1 col1,max(col2) as maxN
    from table
    group by col1
    order by max(col2) desc
      

  4.   

    GROUP BY 是几个字段的,而必须select出所有的字段出来
      

  5.   

    比如表Table 有 A,B,C,D四个字段
            group by(A+B), max(C),D字段也要select出来
      

  6.   

    select a.* from TABLE a,
    (select FIELD1,MFIELD2=max(FIELD2) from TABLE group by FIELD1) b
    where a.FIELD1=b.FIELD1 and a.FIELD2=b.MFIELD2
      

  7.   

    select * from table 
    group by name 
    having (select max(field) from table)
      

  8.   

    select a.* from TABLE a,
    (select FIELD1,MFIELD2=max(FIELD2) from TABLE group by FIELD1) b
    where a.FIELD1=b.FIELD1 and a.FIELD2=b.MFIELD2
    测试过,能用
    在sybase ase中也能用吗?