SELECT *,
CASE
WHEN(max(`priod_id`) > 4) THEN
"0.2"
ELSE
"0.25"
END AS PERCENTAGE,
COUNT(priod_id) as HOURS,
COUNT(CASE
WHEN nota_id = '1' THEN
1
END) AS PR
FROM `attendance_tbl` A
WHERE DATE(attend_date) BETWEEN DATE('2018-08-01') AND DATE('2018-08-31')
AND sid = '60'
GROUP BY DATE(attend_date)
我们需要将百分比和pr(percentage*pr)相乘为总数
请告诉我们解决问题的方法。
1条答案
按热度按时间jjhzyzn01#
一种方法是从现有的
SELECT
查询的结果集。之后,您可以在一个外部的SELECT
条款FROM
派生表。请尝试以下操作: