Currently, the table looks like this. This is basically a list of leaderboards entries everything looks fine at this point.
+-------+-----------------+-------+--------------+--------------+--------------+--------------+----------------------+----------+
| entry | challenge_level | proof | player1_name | player2_name | player3_name | player4_name | submission_date | approved |
+-------+-----------------+-------+--------------+--------------+--------------+--------------+----------------------+----------+
| 8 | 52 | url | PLAYER_A | PLAYER_D | PLAYER_B | PLAYER_C | 2018-07-16T16:14:01Z | true |
| 9 | 60 | url | PLAYER_C | PLAYER_K | PLAYER_X | PLAYER_Y | 2018-07-16T16:33:10Z | true |
| 11 | 51 | url | PLAYER_A | PLAYER_B | PLAYER_C | PLAYER_D | 2018-07-16T17:42:13Z | true |
| 13 | 45 | url | PLAYER_C | PLAYER_H | PLAYER_J | PLAYER_D | 2018-07-16T18:26:59Z | true |
| 14 | 61 | url | PLAYER_A | PLAYER_C | PLAYER_I | PLAYER_B | 2018-07-16T21:09:55Z | true |
| 15 | 36 | url | PLAYER_A | PLAYER_C | PLAYER_D | PLAYER_B | 2018-07-17T08:24:37Z | true |
| 16 | 62 | url | PLAYER_E | PLAYER_C | PLAYER_F | PLAYER_G | 2018-07-17T09:37:13Z | true |
+-------+-----------------+-------+--------------+--------------+--------------+--------------+----------------------+----------+
The problem begins when I would like to have my desired result formatted as following, desired result
+-------+-----------------+-------+--------------+----------------------+----------+
| entry | challenge_level | proof | PLAYER_NAME | submission_date | approved |
+-------+-----------------+-------+--------------+--------------+--------------+---+
| 14 | 61 | url | PLAYER_A | 2018-07-16T16:14:01Z | true |
| 14 | 61 | url | PLAYER_B | 2018-07-16T16:33:10Z | true |
| 16 | 62 | url | PLAYER_C | 2018-07-16T17:42:13Z | true |
| 8 | 52 | url | PLAYER_D | 2018-07-16T18:26:59Z | true |
| 16 | 62 | url | PLAYER_E | 2018-07-16T21:09:55Z | true |
| 16 | 62 | url | PLAYER_F | 2018-07-17T08:24:37Z | true |
| 16 | 62 | url | PLAYER_G | 2018-07-17T09:37:13Z | true |
+-------+-----------------+-------+--------------+--------------+--------------+---+
On top of that, there would be one important factor to consider, players can appear multiple times so, for example, PLAYER_A is listed in multiple entries but the result should be the highest challenge_level he did - player name has to be unique and cant appear multiple times in the desired result.
I do not know where to start with this one, any hints will be valuable.