Table:

2, according to the above-mentioned query subjects the highest, lowest points divide peace, in the form of the following shows: in the following form shows: course ID, class name, the highest and lowest points, average score, pass, medium rate, dykes, proficiency in & gt;=60, medium is: 70-80, the good for: 80-90, good for: & gt;=90 the number of output required courses and elective, the query results in descending order number, if the number is the same, according to the course number ascending order

3, according to the user's current tmp_continous o maximum log in number of days in a row, including time for yyyy - MM - dd format of date;
Table:

Results:

4, still according to tmp_continous for every user of the next day, three days retention rate, output requirements date, retention rate, three rate three columns,
CodePudding user response:
The top two in each subject, can use the cross the apply (select top 2)