Is it possible to use Aggregate function in a Select statment without using Group By clause?

前端 未结 7 1436
-上瘾入骨i
-上瘾入骨i 2020-12-14 18:04

So far I have written Aggregate function followed by Group By clause to find the values based on SUM, AVG and other Aggregate functions. I have a bit confusion in the Group

7条回答
  •  醉梦人生
    2020-12-14 19:03

    You omit columns from the SELECT inside aggregate functions, all other columns should exist in GROUP BY clause seperated by comma.

    You can have query with aggregates and no group by, as long as you have ONLY aggregate values in the SELECT statement

提交回复
热议问题