去重就可以了distinct
或者直接group by
select distinct 编码,单号 from 表
两个字段不重复需用到distinct on,即select distinct on(编码,单号) 编码,单号 from ...