table : match
fields : season, matchday, clubA, clubB, goalsA, goalsB, points
I'v filled the table with matches. And also calculated how many points every match has. (1 for draw, 3 for a win). So I have 306 matches, for a league with 18 clubs.
Now I want to make a query that makes a ranking based on points.
I have made two queries.
1. PARAMETERS Waarde Value;
SELECT DISTINCT match.[Club A]
FROM match
WHERE (((match.season)=[Waarde]));
Which lists the 18 clubs distinctively in the season.
2. PARAMETERS Waarde Value, Club Text ( 255 );
SELECT Sum(match.points) AS SumOfPoints
FROM (Clubs AS CA INNER JOIN match ON CA.ID = match.[Club A]) INNER JOIN Clubs AS CB ON match.[Club B] = CB.ID
WHERE (((match.[goalsA])>[GoalsB]) AND ((CA.[Club naam])=[Club]) AND ((match.season)=[Waarde])) OR (((match.season)=[Waarde]) AND ((match.[goalsB])>[goalsA]) AND ((CB.[Club naam])=[Club])) OR (((match.[goalsA])=[goalsB]) AND ((CA.[Club naam])=[Club]) AND ((match.season)=[Waarde])) OR (((match.season)=[Waarde]) AND ((match.[goalsB])=[goalsA]) AND ((CB.[Club naam])=[Club]));
which gives me the total points of a club in a league if I input the season with the value Waarde and the Club with the value text.
How do I combine these two. For every resultrow of (1) I want the result of (2) presented next to it.
I'v tried these two queries and they both seem to work okay.. but how do I combine them ?
fields : season, matchday, clubA, clubB, goalsA, goalsB, points
I'v filled the table with matches. And also calculated how many points every match has. (1 for draw, 3 for a win). So I have 306 matches, for a league with 18 clubs.
Now I want to make a query that makes a ranking based on points.
I have made two queries.
1. PARAMETERS Waarde Value;
SELECT DISTINCT match.[Club A]
FROM match
WHERE (((match.season)=[Waarde]));
Which lists the 18 clubs distinctively in the season.
2. PARAMETERS Waarde Value, Club Text ( 255 );
SELECT Sum(match.points) AS SumOfPoints
FROM (Clubs AS CA INNER JOIN match ON CA.ID = match.[Club A]) INNER JOIN Clubs AS CB ON match.[Club B] = CB.ID
WHERE (((match.[goalsA])>[GoalsB]) AND ((CA.[Club naam])=[Club]) AND ((match.season)=[Waarde])) OR (((match.season)=[Waarde]) AND ((match.[goalsB])>[goalsA]) AND ((CB.[Club naam])=[Club])) OR (((match.[goalsA])=[goalsB]) AND ((CA.[Club naam])=[Club]) AND ((match.season)=[Waarde])) OR (((match.season)=[Waarde]) AND ((match.[goalsB])=[goalsA]) AND ((CB.[Club naam])=[Club]));
which gives me the total points of a club in a league if I input the season with the value Waarde and the Club with the value text.
How do I combine these two. For every resultrow of (1) I want the result of (2) presented next to it.
I'v tried these two queries and they both seem to work okay.. but how do I combine them ?