Php 我如何查询以学生身份支付的总额?
作为学生id查询并显示为总薪资。我以前曾就这个问题发过帖子。也许我没能澄清我的问题,所以我又发了一次。 请帮帮我Php 我如何查询以学生身份支付的总额?,php,Php,作为学生id查询并显示为总薪资。我以前曾就这个问题发过帖子。也许我没能澄清我的问题,所以我又发了一次。 请帮帮我 列出mysql中的数据 标准id 支付 使用以下查询 select studentID,sum(pay) from tableName group by studentId; 试试这个 select std_id,sum(pay) as total from payment group by std_id 试试这个: 在这里,您需要获得学生方面的金额,因此需要执行GROU
列出mysql中的数据
标准id
支付
使用以下查询
select studentID,sum(pay) from tableName group by studentId;
试试这个
select std_id,sum(pay) as total from payment group by std_id
试试这个:
在这里,您需要获得学生方面的金额,因此需要执行GROUP BY
Student&还需要求和金额,因此需要调用sum
函数并在其中传递金额
下面是MySQL查询:
SELECT std_id AS studentid , SUM(pay) as Amount
FROM table
GROUP BY std_id;
如果您需要进一步的帮助,请告诉我。这是答案还是问题?:)现有的mysql查询是什么?
SELECT std_id AS studentid , SUM(pay) as Amount
FROM table
GROUP BY std_id;