Statistical data together with the sum group by

Excerpt:

      Today saw a sql statistics subject, requires the preparation of statistics to another table sql already known according to the table. Demand is such that there is a teacher table records every day there is a teacher in the curriculum, the table structure is as follows:

 

 The sql is correct, the statement with group by, the query must be field after the group by or statistical functions , then this sum is based on statistical data inside the packet of every row. learned.

 


----------------
Disclaimer: This article is the original article CSDN bloggers "Brad Andy", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/wojiushiwo945you/java/article/details/51151390

Guess you like

Origin www.cnblogs.com/moonsoft/p/12600159.html