【每日一题】SQL 知识大测验 | 持续更新
33
SELECT shipid, paydate, payno
FROM (
SELECT *,
row_number() OVER (PARTITION BY shipid ORDER BY paydate) AS rn_dt,
row_number() OVER (PARTITION BY shipid ORDER BY payno) AS rn_no
FROM orders
)
WHERE rn_dt = 1
AND rn_no = 1
赞0
踩0