表架构:
customers
|_state
|_name
|_customer_id
transactions
|_transact_amt
|_customer_id
这就是我所拥有的:
SELECT state, transact_amt, customers.name
FROM customers
JOIN transactions
ON customers.customer_id = transactions.customer_id;
输出每笔交易的清单。
'state' 'amount' 'name'
AK 948 James J.
AK 747.17 Arthur H.
AL 218.85 Rodney R.
AL 265.42 Rodney R.
如何缩小每个州的前三个最高金额w /名称?