select distinct field1, field2 ,... from tablename;

解决方案 »

  1.   

    是不是对于相同数据只显示一条呀

    id  name
    1   aaa
    1   aaa
    只显示 1 aaa
    可以用distinct
    select distinct id,name from table_name;
      

  2.   

    你 是说只有某一列的数据相同是吧,但整条记录可能不同。如果是 用相过查询 设相同的列名为cla 表名为tab
    select * from tab where cla in (select t.cla from tab t where t.cla=tab.cla);
    这是我以前调试的,