これを1つのクエリにどのように配置しますか?
例えば:
SELECT * FROM `result` WHERE status = 'new' AND YEAR(`end_date`) = '2012' limit 20
SELECT * FROM `result` WHERE status = 'new' AND YEAR(`end_date`) = '2013' limit 20
SELECT * FROM `result` WHERE status = 'new' AND YEAR(`end_date`) = '2014' limit 20
SELECT * FROM `result` WHERE status = 'new' AND YEAR(`end_date`) = '2015' limit 20
SELECT * FROM `result` WHERE status = 'new' AND DAY(`end_date`) = '1' limit 20
SELECT * FROM `result` WHERE status = 'new' AND DAY(`end_date`) = '2' limit 20
... and to 31
and same for the Month Jan to Dec
基本的に各日、月、年の 20 件のレコードを表示します。