यह एक सही समाधान नहीं हो सकता है, लेकिन यह आपको परिणाम दे सकता है:UNION ALL
के बाद दूसरी क्वेरी आंतरिक चयन में MIN(created)
. के बीच सभी तिथियों को वापस करना चाहिए और MAX(created)
काउंटर मान 0 के साथ आपकी तालिका का।
SELECT SUM(a.ctr)
,a.datecreated
FROM
(
SELECT COUNT(*) as ctr, date_format(created, '%d/%m/%y ') as datecreated
FROM mimesi_indexer.meta_served_clips
GROUP BY DATE(created)
UNION ALL
select 0 as ctr, date_format(selected_date, '%d/%m/%y ') as datecreated
from
(select adddate('1970-01-01',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) selected_date from
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4) v
where selected_date
between (SELECT MIN(created) FROM mimesi_indexer.meta_served_clips)
and (SELECT MAX(created) FROM mimesi_indexer.meta_served_clips)
) a
group by a.datecreated
order by month(a.datecreated), date(a.datecreated)