select * from test12where A1 in (select max(A1) from test12 group by A)

解决方案 »

  1.   

    select *
    from table
    where a1>a and a1=(select max(a1) from table)不知我理解的对不
      

  2.   

    select * from table where al =(
    select max(al) as al from table)
    order by a
      

  3.   

    加一个ID字段做标识select * from table where ID in (select max(id) from table group by a)
      

  4.   

    我理解错了。select * from table a,
    (select A,max(A1) as A1 from table group by A) as b
    where a.A = b.A and a.A1 = b.A1
      

  5.   

    不用那么复杂吧select * from table where a+a1 in(select a+max(a1) from table group by a)如果a或a1是INI还要转成字符型
      

  6.   

    chinaiti(小心): 这个方法我也想过:)有BUG的。
    比方说:
    A     A1
     1    22
     12    2
    这两条记录就会搞混。
    改成这样吧:
    select * 
    from table where cast(a as varchar(10))+'_'+cast(a1 as varchar(10)) 
    in(select cast(a as varchar(10))+'_'+cast(max(a1) as varchar(10)) 
       from table group by a)
      

  7.   

    其實只要一句就要可以了
    select A,max(A1) from table group by A