我有下一个 MySQL 表:
|provincias|
| id | |provincia|
|municipios|
| provincia_id| | id | |municipio|
|**event**|
|municipio_id|
|idEvent|
|name|
|date_begin|
|date_end|
我执行下一个 MySQL 查询(已编辑):
SELECT idEvent, name
FROM evento e
INNER JOIN provincias p ON p.id = m.provincia_id
INNER JOIN municipios m ON m.id = e.municipio_id
WHERE provincia = "Iruña de Oka" AND municipio = "Álava"
AND DATE(date_begin) BETWEEN DATE('2013-07-23') AND DATE('2013-07-26')
ORDER BY name;
但我得到下一个错误(已编辑):
1054 - Unknown column 'm.provincia_id' in 'on clause'