我已经编写了这个查询,但是它指出每个表都需要有自己的别名。我做错什么了?据我所知,我给这些表加了别名。
SELECT (a.total_complete_days / b.total_days) * 100 AS "% of complete days"
FROM
(SELECT COUNT(*) AS total_complete_days
FROM (
SELECT email, job_date, SUM(job_minutes)
FROM jobs
GROUP BY email, job_date
HAVING SUM(job_minutes) BETWEEN 200 and 1000
) a,
(SELECT COUNT(*) AS total_days
FROM (
SELECT email, job_date, SUM(job_minutes)
FROM jobs
GROUP BY email, job_date
) b)
1条答案
按热度按时间92vpleto1#
我想你可以把你的问题简化为