This is based off a previous question that I didn't explain properly. So Ive added a more detailed explanation and more images.
I have these 2 tables:
When I type the following code I get the results below which is not a problem.
select customer.travelDate, customer.customer, customer.vehicle,customer.zone, prices.cost FROM customer,prices WHERE
customer.travelDate BETWEEN prices.startDate and prices.endDate
and customer.vehicle=prices.vehicle
and customer.zone=prices.zones;
The problem is that the rates table has a lot of repetition and mistakes can be made easily when inputting new data. I want to know how to setup the same table output with a smaller "Rates" table, example below.
This table has the same values but is considerably smaller and easier to read. I know its possible to do it with php using by only having numbers in the "Zone" row and concatenation.
$zoneNo = $row["zone"];
$query='Select ... FROM ... WHERE customer.zones=rates.zone'.$zoneNo;
but is there a way to do it within MySQL