MySQL Forums
Forum List  »  Newbie

Query for finding count of records that have count(fieldname) > 100
Posted by: Ravi Malghan
Date: February 10, 2019 08:15PM

Need help with building a sql query. I have a table with events from a monitoring system

event_time |signature |
2019-02-10 |sig1 |
2019-02-10 |sig1 |
2019-02-10 |sig1 |
2019-02-10 |sig2 |
2019-02-10 |sig3 |
2019-02-10 |sig3 |
2019-02-10 |sig3 |
2019-02-11 |sig3 |
2019-02-11 |sig3 |
2019-02-11 |sig3 |

I want to 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

2019-02-10 |2 | <- sig1 and sig3 happened 3 times on 2019-02-10
2019-02-11 |1 | <- only sig3 happened 3 times on 2019-02-11

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.