I have two tables users and items in a MySQL DB
Users
pk username
1 John
2 Adam
3 Eve
Items
pk user_pk status
1 1 0
2 1 1
3 2 0
I want create a select that returns all users that have 1 or more items that have status>0.
In the case above I would like to return only John since he is the only one having an item with status 1.
Try this: