1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
SELECT
COALESCE(produits.pdv, produits_stand_by.pdv) AS pdv,
COALESCE(produits.lot, produits_stand_by.lot) AS lot,
COALESCE(produits.yvert, produits_stand_by.yvert) AS yvert,
COALESCE(produits.id_p, produits_stand_by.id_p) AS id_p,
COALESCE(produits.descrip, produits_stand_by.descrip) AS descrip,
COALESCE(produits.stock, produits_stand_by.stock) AS stock,
COALESCE(produits.checked, produits_stand_by.checked) AS checked,
COALESCE(produits.vente, produits_stand_by.vente) AS vente,
clients.*,
commande.*
FROM commande
LEFT JOIN produits ON commande.id_produit = produits.id_p
LEFT JOIN produits_stand_by ON commande.id_produit = produits_stand_by.id_p
LEFT JOIN clients ON commande.id_client = clients.id_c
WHERE commande.id_client='".$_POST['idclient']."'
ORDER BY commande.id_co ASC |
Partager