统计同时具有两个以上工作员工的总工资

        private void button5_Click(object sender, EventArgs e)
        {
            string s = "select workers.wnum as 员工号,workers.wname as 员工名,";
            s += "sum(relate.wage) as 总工资 from workers,relate ";
            s += "where workers.wnum=relate.wnum ";
            s += "and workers.wnum in (select wnum from relate group by wnum having count(cnum)>=2)";
            s += "group by workers.wnum,workers.wname";
            loadLV(listView2,s);
        }

你可能感兴趣的:(统计同时具有两个以上工作员工的总工资)