我希望对我的SELECT
查询和列做一些基本的数学运算..
SELECT Rider,
COUNT(if(Result = 1, Result, NULL)) AS "Firsts",
COUNT(if(Result = 2, Result, NULL)) AS "Seconds",
COUNT(if(Result = 3, Result, NULL)) AS "Thirds",
COUNT(if(Result = " ", Result, NULL)) AS "NP",
COUNT(*) AS "Total",
"Firsts"/"Total"*100 AS "S/R"
FROM meeting_master
WHERE RaceDayDate>="2012-01-01"
GROUP BY meeting_master.Rider
ORDER BY Firsts DESC
LIMIT 100
我的问题(并且缺乏 MySQL 知识)是让S/R
列计算第 7 行中的数学...