简体   繁体   English

查询计算每个月的总工资

[英]query to calculate the total salary for each month

I have a table with 4 fields as follows我有一个包含 4 个字段的表,如下所示在此处输入图像描述

I want an Sql query to calculate a total salary for each month, where the result will be as follows我想要一个 Sql 查询来计算每个月的总工资,结果如下

在此处输入图像描述

Do you just want group by and sum() ?你只想要group bysum()吗?

select sum(salary) salary, month
from mytable
group by month

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM