Почему этот запрос выдает ошибку (#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'of France’ AND Countries . name = ‘France’ ) AND ( Landmarks . top_c' at line 1):
SELECT
*
FROM
Landmarks
INNER JOIN
Localities
ON Landmarks.locality_id = Localities.locality_id
INNER JOIN
Regions
ON Localities.region_id = Regions.region_id
INNER JOIN
Countries
ON Regions.country_id = Countries.country_id
WHERE
(
Localities.name = ‘Normandy’
AND Regions.name = ‘North of France’
AND Countries.name = ‘France’
)
AND
(
Landmarks.top_choice = 1
OR Landmarks.history = 1
OR Landmarks.military = 1
)
AND
( Landmarks.car = 1 )
а точно такой же код, но отформатированный, не выдает ошибку:
SELECT
*
FROM
Landmarks
INNER JOIN
Localities
ON Landmarks.locality_id = Localities.locality_id
INNER JOIN
Regions
ON Localities.region_id = Regions.region_id
INNER JOIN
Countries
ON Regions.country_id = Countries.country_id
WHERE
(
Localities.name = 'Normandy'
AND Regions.name = 'North of France'
AND Countries.name = 'France'
)
AND
(
Landmarks.top_choice = 1
OR Landmarks.history = 1
OR Landmarks.military = 1
)
AND
(
Landmarks.car = 1
)
?