Erreur syntaxe requete sql

Fermé
virus59300 Messages postés 65 Date d'inscription jeudi 1 novembre 2007 Statut Membre Dernière intervention 15 mai 2009 - 5 mai 2009 à 15:32
freto Messages postés 1542 Date d'inscription vendredi 6 juillet 2007 Statut Membre Dernière intervention 8 avril 2016 - 5 mai 2009 à 15:43
Bonjour à toutes et à tous,

j'ai un petit problème de syntaxe dans une requête pouvez vous y jetter un petit oeil?

SELECT
`Products`.`id` AS `id`,
`ProductsCountries`.`new` AS `new`,
`ProductsCountries`.`availability_date` AS `availability_date`,
`ProductsI18N`.`title` AS `title`,
FROM
`Products`
INNER JOIN `ProductsCountries`
ON `Products`.`id` = `ProductsCountries`.`id_product`
INNER JOIN `ProductsI18N`
ON `Products`.`id` = `ProductsI18N`.`id_product`
WHERE
`ProductsCountries`.`id_country` = 'FR'
AND
`ProductsI18N`.`id_culture_code` = 'fr-FR'

voici l'erreur :

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 'FROM `Products` INNER JOIN `ProductsCountries` ON `Products`.`id` = `Pro' at line 6

merci

1 réponse

freto Messages postés 1542 Date d'inscription vendredi 6 juillet 2007 Statut Membre Dernière intervention 8 avril 2016 161
5 mai 2009 à 15:43
Bonjour.
Tu as simplement une virgule en trop juste avant le FROM.
Essaie donc comme ceci:
SELECT
`Products`.`id` AS `id`,
`ProductsCountries`.`new` AS `new`,
`ProductsCountries`.`availability_date` AS `availability_date`,
`ProductsI18N`.`title` AS `title`
FROM
`Products`
INNER JOIN `ProductsCountries`
ON `Products`.`id` = `ProductsCountries`.`id_product`
INNER JOIN `ProductsI18N`
ON `Products`.`id` = `ProductsI18N`.`id_product`
WHERE
`ProductsCountries`.`id_country` = 'FR'
AND
`ProductsI18N`.`id_culture_code` = 'fr-FR' 
0