Intersection de 2 requêtes
Bonjour à toutes et tous
j'ai une table "achats" avec comme champ "id_adherent" et "id_saison"
j'ai besoin de trouver quels sont les adhérents qui ont fait de achats pendant la saison 6 mais qui n'en ont pas fait pendant la saison 5
j'ai bien 2 requêtes différentes mais comment faire l'intersection entre elles ?
Code:
1 2 3 4 5 6 7 8
|
SELECT distinct id_adherent FROM adherents
inner join achats on achats.id_adherent = adherents.ID
WHERE achats.GNF>0 and achats.id_saison=6;
SELECT id_adherent FROM adherents
inner join achats on achats.id_adherent = adherents.ID
WHERE achats.GNF>0 and achats.id_saison=5; |
merci d'avance