Expand my Community achievements bar.

SOLVED

Add a data grouping clause

Avatar

Level 2

Hi team,

 

Does anyone explain the use of  "Add a data grouping clause" in query activity? share any use case for this concept.

Kumar_27_0-1707299891174.png

@_Manoj_Kumar_ @ParthaSarathy @Craig_Thonis @DavidKangni @Marcel_Szimonisz @david--garcia @Denis_Bozonnet @isahore @AnanthanJa @AkshayAnand 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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.

View solution in original post

3 Replies

Avatar

Correct answer by
Employee Advisor

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.

Avatar

Level 2

Hi @Craig_Thonis ,

 

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

Avatar

Level 2

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