distinct只要三个字段中有一个不同,就会取出来

解决方案 »

  1.   

    补充一下,数据库的结构向下面这样
    列1 列2 列3
    001 asc qwe
    002 shd sdsa
    003 asa  sds
    001 asc qwe 
    想要的到的数据是下面的数据
    001 asc qwe
    002 shd sdsa
    003 asa  sds
      

  2.   

    是删除重复记录?用rowid可以不?
      

  3.   

    select distinct clo1,clo2,clo3 from table;
    删除重复:
    delete from table a
          where a.rowid > (select min(b.rowid) from table b 
                            where b.col1=a.col1 
                             and  b.col2=a.col2 and b.col3=a.col3);