select id ,DISTINCT name 
from 表名

解决方案 »

  1.   

    select * from table a where rowid in(select max(rowid) from table where id=a.id and name =a.name)
    我没有测试
    测试正确后记得给分哦
      

  2.   

    select min(id),name from table_name group by name;
      

  3.   

    select * from table1 a 
           where a.rowid in(select min(b.rowid) from table1 b where  b.name =a.name)
      

  4.   

    select id ,DISTINCT name 
    from 表名这个方法我试过了,可以用。