SQL delete condition

Catcheur08 -  
sakoba2010 Messages postés 165 Statut Membre -
Bonjour,

je cherche à savoir si c'est possible de supprimer un champ d'une table que s'il n'existe pas dans une autre table.

Cela donnerai Delete champ1 from table1,table2 where table1.champ1=table2.champ2 si champ1<>champ2 (sinon aucune supression)

Merci
A voir également:

2 réponses

sakoba2010 Messages postés 165 Statut Membre 15
 
Essais ça:

DELETE from tab1 where tab1.nomPersonne NOT IN(Select nom from tab2);

tu peux voir des examples ici:
http://sakoba.byethost13.com/2011/02/07/the-in-and-not-in-predicates/
1
francis
 
remplace ton "si" par un "and"
0