Untitled
By: a guest | Mar 19th, 2010 | Syntax:
MySQL | Size: 0.95 KB | Hits: 65 | Expires: Never
select download_date, download_platform, download_total from
/*This is to fix the empty platform values*/
(select DATE_FORMAT(date(FROM_UNIXTIME(ds_timestamp)), '%Y/%m/%d') as download_date, ds_client_platform download_platform, count(*) download_total
from downloadportal.dr_download_statistics
where length(ds_client_platform) > 0 and (date(FROM_UNIXTIME(ds_timestamp)) between $P{from_date} and $P{to_date})
and (ds_is_update = $P{update})
group by download_date, ds_client_platform
union
select DATE_FORMAT(date(FROM_UNIXTIME(ds_timestamp)), '%Y/%m/%d') as download_date, 'Unknown' download_platform, count(*) download_total
from downloadportal.dr_download_statistics
where length(ds_client_platform) = 0 and (date(FROM_UNIXTIME(ds_timestamp)) between $P{from_date} and $P{to_date})
and (ds_is_update = $P{update})
group by download_date, ds_client_platform) as platform_download_stats
order by download_date, download_platform