There is a table event :
(id_user) (status) 1 active 2 load 3 active 1 load 2 active 3 active 1 active 3 fail For each id_user you must output the number of lines of this id_user , passing by the condition (status="active" OR status="load") AND (status!="fail") . The result is something like this:
(id_user) count(status) 1 3 2 2 id_user = 3 did not hit, because it had one line status!="fail" .
If such a request is possible, a second question is possible immediately, if you need to exclude those id_user that have more than two lines of status!="fail" ?
sum(status="active" OR status="load")and in having checksum(status="fail")to 0 or not more than 2 - MikeAND (status!="fail"), since there are only 3 statuses, and one of them must be absent, the quantity can be considered the usual COUNT (). - Akina