MySQL Forums
Forum List  »  Newbie

Re: Query for finding count of records that have count(fieldname) > 100
Posted by: Peter Brawley
Date: February 10, 2019 08:40PM

> print a row for each day and count of signatures that happened
> more than 3 times. Since sig1 and sig3 happened more than 2 times,
> I shpuld show a count of 2 for 2019-02-10

Which is it, more than 3 times, or more than 2 times, or more than 1 time? Denoting your answer as X, the query would be ...

select event_time, signature, count(*) N
from tbl
group by event_time, signature,
having N > X;

Read about Group By and Having() in the manual.

Options: ReplyQuote




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.