4 messages in com.mysql.lists.mysqlHow to do in one SELECT
FromSent OnAttachments
René Fournier29 Jul 2005 16:40 
Ed Reed29 Jul 2005 17:01 
René Fournier29 Jul 2005 23:09 
SGr...@unimin.com01 Aug 2005 05:55 
Subject:How to do in one SELECT
From:René Fournier (m5@renefournier.com)
Date:07/29/2005 04:40:03 PM
List:com.mysql.lists.mysql

Let's say I have two tables:

USERS

id name 1 John 2 Mary 3 Sue 4 Paul 5 David

WINS id user_id 1 2 2 4 3 3 4 5 5 1 6 4 7 4 8 2 9 3 10 1

How can—in one SELECT statement—fetch and display all the users, along with the number of games they each one, e.g.:

User Games Won

---------------- John 2 Mary 2 Sue 2 Paul 3 David 1

Is this a job for Subselects?

...Rene