美文网首页
统计限定条件下某数据的总和

统计限定条件下某数据的总和

作者: czm123 | 来源:发表于2019-04-01 00:01 被阅读0次
        private void button5_Click(object sender, EventArgs e)
        {
            string s = "select employee.empno as 员工号,employee.empname as 姓名,";
            s += "employee.empage as 年龄,sum(works.salary) as 总工资 ";
            s += "from employee,works where employee.empno=works.empno ";
            s += "and employee.empage>=40 ";
            s += "group by employee.empno,employee.empname,employee.empage ";
            s += "order by sum(works.salary) desc";
            loadLV(listView2,s);
        }

相关文章

网友评论

      本文标题:统计限定条件下某数据的总和

      本文链接:https://www.haomeiwen.com/subject/jkgpbqtx.html