MySQL Forums
Forum List  »  Newbie

Re: Counting Column With Having Statement
Posted by: Peter Brawley
Date: March 13, 2017 09:15AM

Is this what you mean?

select count(*) from (
  SELECT count(id) as count 
  FROM users 
  GROUP BY shop_id 
  HAVING count(shop_id) = 2 
) twofers;

Options: ReplyQuote


Subject
Written By
Posted
Re: Counting Column With Having Statement
March 13, 2017 09:15AM


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.