MySQL Forums
Forum List  »  Newbie

Re: Group Balance Results, Then Count All the Results
Posted by: Peter Brawley
Date: September 29, 2015 12:07PM

> what if I wanted to count all of the groups after the fact

select count(*), credit_limit, N
from ( 
  select credit_limit, count(credit_limit) N
  from customer 
  group by credit_limit
) sums;

A subquery needs parens and an alias ( here `sums`).

Options: ReplyQuote


Subject
Written By
Posted
Re: Group Balance Results, Then Count All the Results
September 29, 2015 12:07PM


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.