select DATE_FORMAT
(f
.upload_time
,'%Y%u') weeks
,
count(*),sum(p
.download_times
),
sum(p
.collection_times
),
sum(p
.click_times
)
from file_base f
left join file_property p
on f
.property_id
= p
.id
group by weeks
;
select DATE_FORMAT
(f
.upload_time
,'%Y-%m-%d') days
,
count(*),sum(p
.download_times
),
sum(p
.collection_times
),
sum(p
.click_times
)
from file_base f
left join file_property p
on f
.property_id
= p
.id
group by days
;
select DATE_FORMAT
(f
.upload_time
,'%Y%m') months
,
count(*),sum(p
.download_times
),
sum(p
.collection_times
),
sum(p
.click_times
)
from file_base f
left join file_property p
on f
.property_id
= p
.id
group by months
;
转载请注明原文地址: https://mac.8miu.com/read-514682.html