
CodePudding user response:
The select G.S no, count (*) as the from CNT GThe join S on G.S no=S.S no
Group by G.S no
The order by CNT desc
Limit 1
CodePudding user response:
Select Sno, count (*) from SGroup by 1 order by 2 desc
LIMIT 1
CodePudding user response:
Most of the students as the number of times may have multiple?CodePudding user response:
Select Sno, count (*) as the from CNT GGroup by Sno
The order by CNT desc
Limit 1
If there are multiple times as students, also can only select one
CodePudding user response:
If considering the maximum have more than one can use the following syntaxSELECT
Sno, COUNT (Sno) AS cou
The FROM
G
GROUP BY Sno
HAVING cou=(SELECT
COUNT (Sno) AS cou
The FROM
G
GROUP BY Sno
The ORDER BY cou DESC
LIMIT 1)