I'm try to write query that will allow me to see how many alarm events when unacknowledged using Postgres by comparing event types against event id's. I'd like to know how many event id's do not have an entry with an event type of 2. For example, the table below would return one event that went unacknowledged.
eventid | eventtype |
---|---|
eventid1 | 1 |
eventid1 | 0 |
eventid2 | 2 |
eventid2 | 0 |
eventid2 | 1 |
Thanks in advance for any help.