我有以下数据:
<表类>
Column_A
Column_B
tbody><<tr>123456 678 123456 999 表类>
除了子查询之外,还可以使用ROW_NUMBER()
,ORDER BY
和GROUP BY
语句,如下所示:
SELECT column_a, column_b
FROM(
SELECT column_a, column_b, row_number() over (partition by column_a order by column_b desc) as rownum
FROM table
)
WHERE rownum=1;