I have two tables, results and constits. In Constits I have area, in results I have party and votes. So results has, for each party the number of votes cast, and further to this an id col in results links it to constits.
I want to see:
SELECT constist.area, results.party, party.votes, (number_of_votes_for_party/total_number_of_votes_for_area)
FROM constits c
INNER JOIN results r
ON c.id = r.id
I am seriously struggling to work this out. I can return the votes per party and total votes per area separatly but I don't know to have both in one query so I can perform the maths.
Thanks
I want to see:
SELECT constist.area, results.party, party.votes, (number_of_votes_for_party/total_number_of_votes_for_area)
FROM constits c
INNER JOIN results r
ON c.id = r.id
I am seriously struggling to work this out. I can return the votes per party and total votes per area separatly but I don't know to have both in one query so I can perform the maths.
Thanks