{MySQL} ERREUR 1064 (42000)

Fermé
BONG03 - 4 févr. 2010 à 12:11
 dordouf - 27 mai 2011 à 15:25
Bonjour,

Voici ma requête :

insert into USER_TO_SERVICE (ID_SERVICE, ID_USER) select ($IDSERVICE, $IDUSERB) where not exists (select ID_SERVICE from USER_TO_SERVICE)

ID_SERVICE et $IDSERVICE sont des entiers ; ID_USER et $IDUSERB sont des varchar (100)

Celle-ci génère l'erreur suivante :
ERROR 1064 (42000) at line 1: 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 not exists (select ID_SERVICE from USER_TO_SERVICE)' at line 1

Quelqu'un peut-il m'aidier ?

MySQL est en version 5.0.32

Merci à tous.

Alf

3 réponses

Xavstarblues Messages postés 10019 Date d'inscription mercredi 22 août 2007 Statut Contributeur Dernière intervention 28 décembre 2019 1 851
4 févr. 2010 à 12:20
je ne suis pas un pro mais il ne manque pas un point-virgule à la fin ?
0
J'ai essyaé en mettant un ; à la fin, mais j'obtiens la même erreur...
0