GROUP BY without aggregate function

后端 未结 9 972
孤独总比滥情好
孤独总比滥情好 2020-11-27 11:28

I am trying to understand GROUP BY (new to oracle dbms) without aggregate function.
How does it operate?
Here is what i have tried.

EMP table on

9条回答
  •  有刺的猬
    2020-11-27 12:21

    You're experiencing a strict requirement of the GROUP BY clause. Every column not in the group-by clause must have a function applied to reduce all records for the matching "group" to a single record (sum, max, min, etc).

    If you list all queried (selected) columns in the GROUP BY clause, you are essentially requesting that duplicate records be excluded from the result set. That gives the same effect as SELECT DISTINCT which also eliminates duplicate rows from the result set.

提交回复
热议问题