select Name,Max(property1) from Table1 group by Name;

解决方案 »

  1.   


      select max(Proerty1),name from aa group by name;
      

  2.   

    如果property1會重復的話,小虫的語句就不對了。
      

  3.   

    select name,property1 from
    (select Name,Max(property1) property1,max(rowid) from Table1 group by Name)
      

  4.   

    你的意思是按name選擇不重復的記錄對嘛?
    select * from Table1 where rowid in
    select max(rowid) from Table1 group by name)
      

  5.   

    不是按name选择不重复的纪录,而是输出的时候只输出一个记录(假设某条纪录由一个property是空,还有一个记录中不为空)。
      

  6.   

    Drate(小虫),LGQDUCKY(飘)的都对, 有空也对。
      

  7.   

    Select A,max(B),C from Table where ... group by A,C我用这句它的错误是: 
     ADODB.Recordset error '800a0cc1' 
    Item cannot be found in the collection corresponding to the requested name or ordinal. 什么原因呢?
    B的值可能是字符串或null。
     
      

  8.   

    看你的错误提示应该是字段名称的问题Select A,max(B) B,C from Table where ... group by A,C
      

  9.   

    select a,max(b) from table where b is not null group by a
      

  10.   

    不对啊,我现在也要输出那些null的。比如:
    a    b
    mm1  
    mm2  as
    mm3   
    mm4  
    mm4  dfd这样我的输出结果要是:
    mm1  as
    mm3
    mm4  dfd
    也就是输出有值的,没有值的话就输出没有的。
      

  11.   

    select * from table1 where rowid in (select max(rowid) from Table1 group by a)