SQL组不在内连接中工作

时间:2018-04-30 22:57:01

标签: sql

 string sqlString =
            "SELECT  task.idtask, SUM(task.hours), task.overtime, 
             task.taskdate, task.description, developers.iddevelopers, developers.developerfname, projects.idprojects, projects.ProjectName" +
            " FROM task" +
            " INNER JOIN developers ON developers.iddevelopers = task.iddevelopers" +
            " INNER JOIN projects ON projects.idprojects = task.idprojects"+
           "GROUP BY projects.ProjectName ";

如何以ProjectName的分组顺序获得结果

the table at the moment without the group by

1 个答案:

答案 0 :(得分:0)

您必须在select语句中包含不是加重的每个列。

GROUP BY projects.ProjectName,task.idtask,task.overtime,              task.taskdate,task.description,developers.iddevelopers,developers.developerfname,projects.idprojects