Home > database >  Beginners SQL server encountered an inter-bank averaging (rows), for bosses.
Beginners SQL server encountered an inter-bank averaging (rows), for bosses.

Time:03-23

As shown in figure:

Specific issues are as follows: similar data for a total of 40 w + article, and the average examination subjects, each of the students (each subject scores/subject), without the same student
Thank you very much!

CodePudding user response:

 
SELECT name, course, scores,
Average score=avg (mark) over (partition by name)
The FROM
YourTable
Where condtitions=@ condtitions

CodePudding user response:

 
Select name, avg (mark)
The from
YourTable
Group by name

CodePudding user response:

Select name, avg (mark)
The from
YourTable
Group by name
  • Related