J'essaie de monter une requête SQL qui m'afficherais tous les produits en cours de commande fournisseur, en statut 1, 2, 3 et 4.
Je me base donc sur la requête suivante concernant le statut 1 :
SELECT SQL_CALC_FOUND_ROWS a.* , s.name AS supplier, w.name AS warehouse, stl.name AS state, st.delivery_note, st.editable, st.enclosed, st.receipt_state, st.pending_receipt, st.color AS color, a.id_supply_order as id_export FROM `ps_supply_order` a LEFT JOIN `ps_supply_order_state_lang` stl ON ( a.id_supply_order_state = stl.id_supply_order_state AND stl.id_lang = 1 ) LEFT JOIN `ps_supply_order_state` st ON a.id_supply_order_state = st.id_supply_order_state LEFT JOIN `ps_supplier` s ON a.id_supplier = s.id_supplier LEFT JOIN `ps_warehouse` w ON (w.id_warehouse = a.id_warehouse) WHERE 1 AND a.is_template = 0 AND stl.`name` LIKE '%1%' AND stl.`name` LIKE '%1%' ORDER BY a.`id_supply_order` ASC LIMIT 0, 50
A cette requête, je souhaiterais ajouter les statuts 2, 3 et 4 :
BLABLABLA... WHERE 1 AND a.is_template = 0 AND stl.`name` LIKE '%2%' AND stl.`name` LIKE '%2%' ORDER BY a.`id_supply_order` ASC LIMIT 0, 50
BLABLABLA... WHERE 1 AND a.is_template = 0 AND stl.`name` LIKE '%3%' AND stl.`name` LIKE '%3%' ORDER BY a.`id_supply_order` ASC LIMIT 0, 50
BLABLABLA... WHERE 1 AND a.is_template = 0 AND stl.`name` LIKE '%4%' AND stl.`name` LIKE '%4%' ORDER BY a.`id_supply_order` ASC LIMIT 0, 50
Pourriez-vous m'aider pour en faire une seule requête ?
Merci de vos lumières