MySQL Forums
Forum List  »  Newbie

Re: Dividing a count by another count
Posted by: Peter Brawley
Date: September 01, 2020 12:48PM

> I can't hard copy "Show Create Table"

Sure you can. Run the cmd in the mysql client program, terminate with with \G, copy the result, paste it here.

For your query, is this what you mean?

select round( avg(N), 1 ) as avg
from (
  select a.code_matricule, count(e.code_emprunt) N
  from abonne a
  join emprunt e using(code_matricule)
  group by code_matricule
) x;

Options: ReplyQuote


Subject
Written By
Posted
Re: Dividing a count by another count
September 01, 2020 12:48PM


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.