select distinct *
from table;
select distinct name,age
from table
where 条件; 
去除重复即可

解决方案 »

  1.   

    是重复的A字段只取一条记录 不是 一行所有字段都相同
    select distinct A,B
    from table 是不行的
      

  2.   


    --取B字段较大的
    select A, max(B) from table group by A;
    --取B字段较小的
    select A, min(B) from table group by A;
      

  3.   

    select *
      from (select 表A.A,
                   表A.B,
                   row_number() over(patition by 表A.A order by 表A.B) as rn
              from 表A) t
     where t.rn = 1;