I have a table "player" as follow where: ID is primary key.
- date = date they play (just for 1 month, so could from 1 to 31)
- Name = name of the players
- Sport = sport they play and there can be many sports in the list; but i only focus on the one who play "football" and play more than 2 games in one day
This is the table "player".
+----+------------+-------+-------------+
| ID | Date | Name | Sport |
+----+------------+-------+-------------+
| 1 | 1 | A | football |
| 2 | 1 | A | soccer |
| 3 | 3 | A | tennis |
| 4 | 2 | B | tennis |
| 5 | 2 | B | football |
| 6 | 1 | C | basketball |
| 7 | 1 | C | tennis |
| 8 | 1 | C | fishing |
| 9 | 4 | D | football |
+----+------------+-------+-------------+
I want to find list of the people (name and sport) who DO NOT:
- practice "football" + other sport(s) in one day.
note: if someone who play "football" + other game(s) in one day, we remove him from the list for that day. only remove him for that particular day.
So the result should be like this,
+----+------+------+-----------+
| ID | Date | Name | Sport |
+----+------+------+-----------+
| 3 | 3 | A | tennis |
| 6 | 1 | C | basketball|
| 7 | 1 | C | tennis |
| 8 | 1 | C | fishing |
| 9 | 4 | D | football |
+----+------+------+-----------+
This is the follow up problem listed mysql: find rows with repeated values plus condition
thank you for helping !