我不想考虑每个id: ponnumber有多个ORD的一行表
<表类>
PONUMBER
奥德
QTYORDER
tbody><<tr>1 1 200 12 100 13 100 表类>
您可以这样使用row_number
:
with u as
(select *,
row_number() over(partition by PONUMBER order by QTYORDER desc) as rn
from table_name)
select PONUMBER, ORD, QTYORDER from u
where rn <> 1;
小提琴