+-------------------------------------------------+-----------------+---------------------+
| landing_page | all_impressions | dates |
+-------------------------------------------------+-----------------+---------------------+
| https://www.example.co.uk/url-1 | 53977 | 2018-08-19 13:59:40 |
| https://www.example.co.uk/url-1 | 610 | 2018-09-19 13:59:40 |
| https://www.example.co.uk/url-1 | 555 | 2018-10-19 13:59:40 |
| https://www.example.co.uk/url-1 | 23 | 2018-11-19 13:59:40 |
| https://www.example.co.uk/ | 1000 | 2018-06-19 13:59:40 |
| https://www.example.co.uk/ | 2 | 2018-07-19 13:59:40 |
| https://www.example.co.uk/ | 4 | 2018-08-19 13:59:40 |
| https://www.example.co.uk/ | 1563 | 2018-09-19 13:59:40 |
| https://www.example.co.uk/ | 1 | 2018-10-19 13:59:40 |
| https://www.example.co.uk/ | 9812 | 2018-11-19 13:59:40 |
+-------------------------------------------------+-----------------+---------------------+
With the above database table, I only want to select the landing_page if the impression count is the max for the current date - For example, from this, the select would return https://www.example.co.uk/ only as the current month it's all_impressions value is it's highest for November (https://www.example.co.uk/url-1 would not be selected as it's highest value was in August)
How might I do this with SQL?
index info:
mysql> show indexes from landing_pages_client_v3;
+-------------------------+------------+--------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------------------------+------------+--------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| landing_pages_client_v3 | 0 | PRIMARY | 1 | id | A | 24279939 | NULL | NULL | | BTREE | | |
| landing_pages_client_v3 | 1 | profile_id | 1 | profile_id | A | 17 | NULL | NULL | YES | BTREE | | |
| landing_pages_client_v3 | 1 | profile_id | 2 | dates | A | 17 | NULL | NULL | | BTREE | | |
| landing_pages_client_v3 | 1 | profile_id_2 | 1 | profile_id | A | 17 | NULL | NULL | YES | BTREE | | |
| landing_pages_client_v3 | 1 | profile_id_2 | 2 | lp_id | A | 6069984 | NULL | NULL | YES | BTREE | | |
+-------------------------+------------+--------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+