📅  最后修改于: 2022-03-11 15:05:24.854000             🧑  作者: Mango
SELECT columnlist,
rn = ROW_NUMBER() OVER (PARTITION BY sales.salesID ORDER BY payment.paymentID)
FROM sales JOIN payments ON sales.salesID=payments.salesID