0

Please I need your help. I am talking about MySQL Database.

This is my query :

SELECT llx_facturedet.rowid, llx_societe.nom, llx_societe_extrafields.prof, llx_facture.ref, llx_facture.date_valid, llx_product.label, llx_facturedet.qty, llx_facturedet.subprice, llx_facturedet.total_ht FROM llx_societe CROSS JOIN llx_societe_extrafields ON llx_societe.rowid = llx_societe_extrafields.fk_object CROSS JOIN llx_facture ON llx_societe.rowid = llx_facture.fk_soc CROSS JOIN llx_facturedet ON llx_facture.rowid = llx_facturedet.fk_facture CROSS JOIN llx_product ON llx_product.rowid = llx_facturedet.fk_product ORDER BY rowid;

Here is the result :

enter image description here

You can notice that, patient6 and patient8 took the same date the items Product1 and Service1.

enter image description here

Hence, their invoice references and names are included in each item added.

How can I solve this without ignoring any ordered items?

Jack D
  • 1
  • What was the result you were expecting? – hrokr Mar 21 '22 at 12:42
  • I want to have a result so that in the fields name, prof, ref and date_valid the same values cannot be repeated when a customer has several items. Thanks for your help. – Jack D Mar 21 '22 at 13:55
  • I think this answer will do you (https://stackoverflow.com/questions/8099747/how-to-avoid-duplicate-on-joining-two-tables) – hrokr Mar 24 '22 at 15:56

0 Answers0