J'ai une table contenant des évènements :
CREATE TABLE `evenements` (
`id` int(8) NOT NULL AUTO_INCREMENT,
`Nom` varchar(50) NOT NULL,
`Debut` date NOT NULL,
`Fin` date NOT NULL,
PRIMARY KEY (`id`),
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
Ainsi qu'une table contenant les inscriptions à ces évènements :
CREATE TABLE `evenements_inscriptions` (
`inscr_id` int(8) NOT NULL AUTO_INCREMENT,
`evenement_id` int(8) NOT NULL,
`client_id` int(8) NOT NULL
PRIMARY KEY (`inscr_id`),
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
je cherche à sélectionner tous les évènements auxquelles un client ne participe pas.J'ai fait :
SELECT e.`id`, e.`Nom`
FROM `evenements` e
INNER JOIN `evenements_inscriptions` i
ON (e.`id` <> i.evenement_id AND i.client_id = '3924')
WHERE e.Fin >= '2010-03-11'
ORDER BY e.Debut
Ca fonctionne comme il faut si mon client est déjà inscrits à au moins un évènement, mais il ne me retourne rien si le client n'est pas encore inscrit !Comment faire pour lui dire "ON (e.`id` <> i.evenement_id AND i.client_id = '3924' MEME_SI i.client_id = introuvable)" ?
Merci de votre aide.