--查询某字段不重复数据并取出最新的select * from (select m.proposalno,m.operatedate,m.underwriteflag ,row_number() over(partition by underwriteflag order by operatedate desc ) as row_flgfrom prptmain m ) temp where temp.row_flg=1