SELECT rcatalogue.*, rcategorie.id_categorie, rmarque.id_marque, rfournisseur.id_fournisseur, rcatalogue_groupe.id_groupe FROM rcatalogue LEFT JOIN `rcategorie` ON rcatalogue.id_rcatalogue = rcategorie.id_rcatalogue LEFT JOIN `rmarque` ON rcatalogue.id_rcatalogue = rmarque.id_rcatalogue LEFT JOIN `rfournisseur` ON rcatalogue.id_rcatalogue = rfournisseur.id_rcatalogue LEFT JOIN `rcatalogue_groupe` ON rcatalogue.id_rcatalogue = rcatalogue_groupe.id_rcatalogue HAVING (datd_rcat = 0 or 1714374605 > datd_rcat) and (datf_rcat = 0 or 1714374605 < datf_rcat) and ( (id_categorie IS NULL) or ( id_categorie IN ( SELECT id_categorie FROM pcategorie WHERE (id_produit=3372 or id_produit=0) ) ) ) and ( (id_marque IS NULL) or (id_marque = '22') ) and ( (id_fournisseur IS NULL) or ( id_fournisseur IN ( SELECT id_fournisseur FROM achat WHERE (id_produit=3372 or id_produit=0) ) ) ) and ( (rcatalogue_groupe.id_groupe IS NULL) OR (rcatalogue_groupe.id_groupe = '0') )