CodePudding user response:
SELECT cno,COUNT (1)/(SELECT COUNT (1) the FROM table) AS elective rate
FROM table
GROUP BY cno;
CodePudding user response:
Elective rate refers to the number one cno proportion in all cno number or select a certain number of cno, the sno, accounts for the proportion of all sno numberCodePudding user response:
If it is the second(SELECT COUNT (1) the FROM table) which have to do is to query the total number of students with distinct row heavy