Add a data grouping clause | Community
Skip to main content
Craig_Thonis
Craig_ThonisAccepted solution
Employee
February 20, 2024

Hi Kumar,

The Add a grouping clause means that you are adding a Group By to the generated SQL statement. To understand how a Group By works, check out the documentation below:

https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-group-by/

 

To put it simply, as the name suggests, the function allows results to be grouped by certain criteria such as grouping recipients by country.

3 replies

Level 2
April 26, 2025

I will share one usecase. Recipients who more than 5 sales
Ex: Two tables are there. 
Recipient and product sales.
Add grouping condition like
Count(OrderId) greater than 5.

OrderId is from product sales table. So it will count number of purchases by customer and it is greater than 5. They only will be the target audience


Translate
Craig_Thonis
Craig_ThonisAccepted solution
Employee
February 20, 2024

Hi Kumar,

The Add a grouping clause means that you are adding a Group By to the generated SQL statement. To understand how a Group By works, check out the documentation below:

https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-group-by/

 

To put it simply, as the name suggests, the function allows results to be grouped by certain criteria such as grouping recipients by country.

Translate
Kumar_27Author
Level 2
February 20, 2024

Hi @craig_thonis ,

 

Thanks for your response. For my better understanding please provide any use case / Hands-on it's very helpful to understanding.  

Translate