I am taking calculated totals from two different tables that are related to try and find the rate of Crime to Population.
So here is my code:
SELECT SUM(INCIDENT_BY_REGION.Total) AS TotalCrime,
SUM(REGION.Population) AS TotalPopulation,
(TotalCrime/TotalPopulation) AS Rate
FROM INCIDENT_BY_REGION JOIN REGION
ON INCIDENT_BY_REGION.RegionID = REGION.RegionID;
But I get an error,
Error Code 1054: Unknown Column 'TotalCrime' in 'field list
.
What I want is to find the rate of the population to crime. Any suggestions?