sql 单列去重

select * from 表名  where 主键 in(select max(主键)   from 表名 group by 要去重的字段 )  

 select * from fms_produce_sampleframe_receive  where sampleframe_receive_id in(select max(sampleframe_receive_id)   from fms_produce_sampleframe_receive  group by produce_order_id ) 

原文地址:https://www.cnblogs.com/Mr-Y1907/p/14765155.html