59
Views
5
Comments
Solved
Select distinct? Data performance with Group By
Question
Application Type
Reactive

Hello again,

Please, I need to show project list join projectteam. Obviously the project name is repeating, so, I would like to set the field that I want in my agregate. Is there a way for this?

My alternative test was group by name, but I got two problems: performance got down and my agregate now only show the column of group by on my agregate (seting fields the id not exists but opening my agregate there is some fields there).

Where I'm going wrong on this issue?


Thanks

data_issue2.PNG
data_issue.PNG
2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello

To get the unique data plus all other attributes we can use Advance SQL Row_Number() function with partition by, by the use of this we will get the row number of each record what we can do we will check in a where condition that rownumber =1 that means  only records that are unique.

To know more on it just check on google about row_Number function to fetch unique records.

2023-06-17 23-16-53
Elaine Guimaraes

Thank you Tousif

2025-02-01 08-24-49
Sathish Karunakaran

Hi @Elaine Guimaraes,

When to use group by to get distinct values, It will return only attribute that are grouped. Please refer this document - https://success.outsystems.com/documentation/11/developing_an_application/use_data/query_data/get_distinct_values_from_the_database/

2023-06-17 23-16-53
Elaine Guimaraes

Thanks Sathish,

I am doing another list excluding the rwpeated project description. I saw this way in another post here in community.


Thanks!

2023-10-21 19-42-11
Tousif Khan
Champion

Hello

To get the unique data plus all other attributes we can use Advance SQL Row_Number() function with partition by, by the use of this we will get the row number of each record what we can do we will check in a where condition that rownumber =1 that means  only records that are unique.

To know more on it just check on google about row_Number function to fetch unique records.

2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello

To get the unique data plus all other attributes we can use Advance SQL Row_Number() function with partition by, by the use of this we will get the row number of each record what we can do we will check in a where condition that rownumber =1 that means  only records that are unique.

To know more on it just check on google about row_Number function to fetch unique records.

2023-06-17 23-16-53
Elaine Guimaraes

Thank you Tousif

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.