我的查询效果很好。唯一的问题是它除了从select语句中从我的数据库中提取的行数。我该如何更改
(SELECT COUNT(*) FROM saved_players))
让我们说1000? 1000是会员总数。
$query= "SELECT *, COUNT(*) AS Total , (COUNT(*) / (SELECT COUNT(*) FROM saved_players)) * 100 AS totalnumber
FROM saved_players
GROUP BY fname";
所以我正在寻找类似下面的内容,但它不起作用。
$query= "SELECT *, COUNT(*) AS Total , (COUNT(*) / 1000 * 100 AS totalnumber
FROM saved_players
GROUP BY fname";
答案 0 :(得分:0)
$query= "SELECT *, COUNT(*) AS Total , (COUNT(*) / 1000 * 100) AS totalnumber
FROM saved_players
GROUP BY fname";
看起来像缺少括号)
。
希望这有帮助