MySQL: How to Write a Query That Returns the Top Records in a Group

https://towardsdatascience.com/mysql-how-to-write-a-query-that-returns-the-top-records-in-a-group-12865695f436 SET @group_rank := NULL; SELECT * FROM ( SELECT *, @group_hash := CONCAT(`column1`, '-', `column2`) AS _group_hash, @group_rank := IF(@group_value = @group_hash, @group_rank + 1, 1) AS _group_rank, @group_value := @group_hash AS _group_value FROM `your_table` AS `_your_table` ORDER BY `column1` ASC, `column2` ASC ) AS `_sub_table` WHERE `_sub_table`.`_group_rank` <= 2 ;

SendGrid guides

https://sendgrid.com/resources/guides/ 24 Email Marketing Best Practices Tips for 2020 Email Design Best Practices for 2019 The Expert’s Guide to Social and Display Ads