J'ai les tables suivantes:
table article
table article_fournisseurARTICLE_IDENTIFIANT ARTICLE_NOM
1 test
2 essai
3 nouveau
4 test12
Le 'fournisseur vide' me permet d'afficher la liste de tous les articles ayant été commandé auprès de n'importe quel fournisseurARTICLE_FOURNISSEUR_ARTICLE ARTICLE_FOURNISSEUR_FOURNISSEUR ARTICLE_FOURNISSEUR_PRIX
1 1 (fournisseur vide)
1 3 10
1 8 12
4 1 (fournisseur vide)
4 7 13
table commande_details
La commande 100 est passé au fournisseur 8, j'aimerais donc au moment de l'édition du bon de commande sortir la liste des articles par rapport au n° de commande.COMMANDE_IDENTIFIANT ARTICLE_IDENTIFIANT
100 1
100 4
Ce qui donnerait une requete du style
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 SELECT * FROM commande_details, article_fournisseur, article WHERE commande_details.COMMANDE_IDENTIFIANT = 100 AND commande_details.ARTICLE_IDENTIFIANT = article_fournisseur.ARTICLE_FOURNISSEUR_ARTICLE AND article_fournisseur.ARTICLE_FOURNISSEUR_FOURNISSEUR = (8 si l''article est enregistré pour ce fournisseur sinon 1) AND commande_details.ARTICLE_IDENTIFIANT = article.ARTICLE_IDENTIFIANT
Partager