How do I use T-SQL Group By

后端 未结 5 1515
星月不相逢
星月不相逢 2020-12-06 04:17

I know I need to have (although I don\'t know why) a GROUP BY clause on the end of a SQL query that uses any aggregate functions like count,

5条回答
  •  甜味超标
    2020-12-06 04:52

    GROUP BY also helps when you want to generate a report that will average or sum a bunch of data. You can GROUP By the Department ID and the SUM all the sales revenue or AVG the count of sales for each month.

提交回复
热议问题