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 ) 

posted @ 2021-05-13 16:41  喜欢22度的晴天  阅读(235)  评论(0编辑  收藏  举报