Re: complex mysql query
Is this what you mean?
SELECT s.nom, count(c.id) as contracts_number, sum(c.montant) * m.numbre as total
FROM societees AS s
JOIN contrats AS c ON s.id = c.societes_id
JOIN contracts_machines m ON c.id = m.contracts_id
GROUP BY s.nom;
If not, please say how not, and post the Show Create Table result for each of the tables.
Subject
Written By
Posted
Re: complex mysql query
April 17, 2022 11:44AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.