我想计算正面、中性、负面反馈的数量。
我有这 3 个看起来非常相似的查询。有没有办法可以将所有这些放入一个查询中?或者它是最简洁的方式吗?
预先感谢,问候。
$total_positive_seller = mysql_num_rows(mysql_query("SELECT id FROM feedback
WHERE seller='$user' AND feedback='positive'"));
$total_neutral_seller = mysql_num_rows(mysql_query("SELECT id FROM feedback
WHERE seller='$user' AND feedback='neutral'"));
$total_negative_seller = mysql_num_rows(mysql_query("SELECT id FROM feedback
WHERE seller='$user' AND feedback='negative'"));