Frequency Table by user in SQL

Posted by Roberto on Stack Overflow See other posts from Stack Overflow or by Roberto
Published on 2010-05-27T23:26:49Z Indexed on 2010/05/27 23:31 UTC
Read the original article Hit count: 346

Filed under:
|

Very basic SQL question (DB is MySQL):

I want a table of number of transactions by users.

User ID   Transaction count
1         43
2         213
3         0
4         23
5         0

In a table I have the two relevant records (user_id and buy_count).

How could I get the table I want?

Thanks,

Roberto

© Stack Overflow or respective owner

Related posts about sql

Related posts about mysql