Results 1 to 3 of 3
Jun 14, 2003, 18:47 #1
- Join Date
- Dec 2000
- The flat edge of the world
- 0 Post(s)
- 0 Thread(s)
Can I have multiple COUNT() on same table?
Using MySQL, I have an athlete table, with ath_no and team_no
A team table that has the key team_no
And a table call extras, that has the ath_no, a column call tshirt_size, the tshirt column can either be NULL, S, M, or L. There's another column call ticket (to see if the athlete has a ticket or not), and it can be either 0 or 1.
A team has many athletes, and each athlete belongs to one team, each athlete has a tshirt_size and a 0 or 1 in the ticket column in the extras table.
Is it possible that for each team, to count the number of shirts for each size and the number of tickets?
eg. a query that will generate something like:
TeamName S M L Tickets ---------------------------------- Team 1 5 0 2 17 Team 2 4 5 0 8Work smarter, not harder. -Scrooge McDuck