答案 0 :(得分:2)
在MySQL中使用以下查询:
SELECT C.groupname,C.marks FROM querysecondval C LEFT JOIN(SELECT A.groupid,IFNULL(B.groupid,0)groupid2 FROM querysecondval LEFT JOIN(选择B.groupid FROM querysecondval B GROUP BY B.groupname order by B.groupid)B ON A.groupid = B.groupid )D ON C.groupid = D.groupid WHERE D.groupid2 = 0 GROUP BY C.groupname order by C.groupid