0
SELECT * FROM `111_dossier` AS d
LEFT JOIN `008_vehicule` AS v
LEFT JOIN `053_dates` AS da
LEFT JOIN `descriptif` AS des

WHERE (`d.site_gestion` = 57 OR `d.site_creation` = 57)
AND `d.etat_dossier` IN("V","W")
AND year(`da.date_entree`) >= 2014
AND `v.marque` = "Tesla"
AND `des.C4` LIKE %LONGERON% 

#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 'WHERE (d.site_gestion = 57 OR d.site_creation = 57) AND d.etat_dossier IN(' at line 6

*

I'm trying to run this request since 2 hours , can someone help me? Sorry, I think that it's only a small error in the syntax but I'm a beginner.

Suggest the changes to be done.

Shubham Shekhar
  • 173
  • 2
  • 15
  • 1
    you are joining without an `ON` condition. you Need to tell your query how the tables fit together – RealCheeseLord Aug 09 '17 at 11:48
  • 1
    In a left join you have to use the `ON` clause have a look here: https://stackoverflow.com/questions/16470942/can-i-use-mysql-join-without-on-condition So in your case it would probably be something like `LEFT JOIN 008_vehicule AS v ON v.id = d.vehicule_id ...` – Doktor OSwaldo Aug 09 '17 at 11:49
  • There are saeveral errors in there. Please take a SQL tutorial. This is really basic – juergen d Aug 09 '17 at 11:53

0 Answers0