(mysqli): select COMMANDE.*,COMMANDE_AVOIR_REF_STATUT.*, (select count(*) from COMMANDE_CONTENIR_ARTICLE_EXISTER_CONDITIONNEMENT where PKFKID_COMMANDE = ID_COMMANDE) as mycount from COMMANDE inner join COMMANDE_AVOIR_REF_STATUT on PKFKID_COMMANDE=ID_COMMANDE where FKID_CLIENT=0 and DATET_CARS_CREATE=(select DATET_CARS_CREATE from COMMANDE_AVOIR_REF_STATUT where PKFKID_COMMANDE=ID_COMMANDE and BE_CARS_DELETE<>1 order by DATET_CARS_CREATE DESC limit 1) order by DATET_CARS_CREATE DESC  

Mes commandes

Commande Paiement Prix Date Status