MySQL Forums
Forum List  »  Newbie

Re: complex mysql query
Posted by: Peter Brawley
Date: April 17, 2022 11:44AM

Is this what you mean?

SELECT s.nom, count( as contracts_number, sum(c.montant) * m.numbre as total
FROM societees AS s
JOIN contrats AS c ON = c.societes_id
JOIN contracts_machines m ON = 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.

Options: ReplyQuote

Written By
April 16, 2022 10:08PM
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.