此查询不使用Php在GCP中执行。相同查询在本地服务器中执行。 请建议我如何获得结果?
select sum(decl_count) as decl_count , sum(counts) as total
FROM
(select dates,max(version) as version, counts, decl_count
FROM
(select version, count(declaration) as counts,
count(case when declaration=1 then 1 else null end) as decl_count,
date(productiondate) as dates FROM table_name
WHERE edition='abc' and MONTH(productiondate) = MONTH(CURRENT_DATE())
AND YEAR(productiondate) = YEAR(CURRENT_DATE())
GROUP BY version, date(productiondate)
ORDER BY version DESC ) AS temp
GROUP BY dates ORDER BY dates DESC) as temp2