2010-08-18 57 views

回答

1

有很多方法可以做到這一點,這裏有一個

SELECT COUNT(client_id) AS transaction_count, client_id 
    FROM transactions 
    GROUP BY client_id 
    ORDER BY COUNT(client_id) DESC 
    LIMIT 1 
+0

這就行了。謝謝大家。 – JoaoPedro 2010-08-18 13:20:56

0

SELECT * FROM Transactions ORDER BY amount DESC LIMIT 1

0

一種解決方案是:

SELECT `client_id`, COUNT(*) AS c_num 
FROM `transaction` 
GROUP BY `client_id` 
ORDER BY `c_num` ASC 
LIMIT 1