+ 4
Does GROUP BY clause needs an aggregate function??
In MySQL I've seen "GROUP BY" work without any aggregate functions but the general syntax is quite different...... Can anyone please clear this contradiction??
9 ответов
0
Well, it works in Postgres
https://drive.google.com/file/d/1Lw3ZYTMhYe0achq-Dt83KDU7mFbwRA_g/view
+ 3
yup you're right buddy
sorry for wasting your time 😊
+ 2
Rustem Sharipov it won't work anywhere else other than mysql
+ 1
It never worked in Postgres
+ 1
thanks Shin one Chan sort of a famous cartoon character 🤣
0
Aggregate functions can be omitted. E.g.instead of:
Select customer,Sum(sales) Group by customer
we can just run:
Select customer Group by customer
0
NULL_ptr It works. At least in MySQL, in SQL Server and in PostgreSQL.
0
NULL_ptr no problema frd!
0
It's works. The result will be the same as if use DISTINCT clause with the same columns but usually GROUP BY is faster.