I am writing a large SQL query and have narrowed down the problem to the following (simple example).
id | status |
---|---|
1 | -1 |
2 | 1 |
3 | -1 |
3 | 1 |
Now I want to filter out all ids which never have a status of 1. In this example, I only want to return id 1 since id 3 both can have status 1 and -1. How can I do that?