|
Posted by J.O. Aho on 03/12/06 02:05
Sébastien wrote:
> Hi,
>
> I'm working on a website using a PayPal, with a custom PHP/MySQL
> (v4.0.17, very unlikely to be able to upgrade for this project) shopping
> cart. This is only to let you know about the setup.
>
> Now to my question:
>
> I have a table with transaction informations, in which I have a line for
> each transacion, containing a user identifier, their country of
> residence, the amount of the transaction, and much more.
>
> I want to be able to tell which user is the best buyer (or maybe the
> best 10/20 buyers).
> I also want to know which country buys the most.
Use GROUP BY
http://dev.mysql.com/doc/refman/5.0/en/group-by-modifiers.html
//Aho
[Back to original message]
|