michaelw00d
Programmer
Hi,
Im not sure how I am supposed to calculate the result I require without somehow querying the initial query in mySQL.
I basically have a table which has GroupID's and Matches in it. I want to run a query which shows all the records where there are more than 2 Matches, and show how many records there are per GroupID.
I would normally make a query which gets all the records where there are more than 2 matches, then make a query which sums them and groups them, as I normally work in MS Access. However I don't know how to do the same result in mySQL.
Just to clarify:
TABLE
GroupID Matches
1 2
1 3
1 4
1 1
2 4
RESULT REQUIRED
GroupID COUNT(Matches)
1 2
2 1
Thanks for any help!
Im not sure how I am supposed to calculate the result I require without somehow querying the initial query in mySQL.
I basically have a table which has GroupID's and Matches in it. I want to run a query which shows all the records where there are more than 2 Matches, and show how many records there are per GroupID.
I would normally make a query which gets all the records where there are more than 2 matches, then make a query which sums them and groups them, as I normally work in MS Access. However I don't know how to do the same result in mySQL.
Just to clarify:
TABLE
GroupID Matches
1 2
1 3
1 4
1 1
2 4
RESULT REQUIRED
GroupID COUNT(Matches)
1 2
2 1
Thanks for any help!