Bonjour à tous,
Désolé pour le titre pas très explicite.
Voilà sois Trois table contenant tout une colonne products_id.
Je cherche à faire un requete de tous les products_id qui n'apparaissent pas dans une des tables
Donc sur deux tables ca donne ceci, et ca fonctionne:
Désormais j'aimerais le faire sur les trois table,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 select distinct products_id,products_quantity from " . TABLE_PRODUCTS . " where (products_id NOT IN (select products_id from ".TABLE_PRODUCTS_TO_CLASSIFICATION."))
t1.products_id = t2.products_id et n'appartient pas à la 3ème table.
j'ai donc essayer ceci:
ca me revois bien les bon products_id mais pas le product_name.?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 SELECT p.products_id, pd.products_name FROM products p LEFT JOIN products_description pd ON pd.products_id = p.products_id WHERE ( p.products_id NOT IN (SELECT products_id FROM products_to_classification) ) LIMIT 0 , 30
Merci à vous
Partager