I have an event table in the form:
| User | Event | Date |
| User A | Failed Log In | ... |
| User A | Failed Log In | ... |
| User B | Failed Log In | |
| User A | Successful Log In | |
| User B | Successful Log In | |
What I would like to do is to count all the 'failed log ins' for each user since the last 'successful log in' so I can create a view in the form:
| User | Failed Log in attempts |
| User A | 2 |
| User B | 1 |
Is this possible to do in SQL? Or do I need to pull this logic out into my app?