130
Views
5
Comments
Duplicate Records
Question
Hello

How can i avoid the duplicate recording on my Aggregate as you w'll see at this attachement please can you bring me a solution,and i'm sorry if i posted for severls issus because really i want to accomplish this project imediatly but i also have problems with my application
Thanks
UserImage.jpg
Ilham Rania
I'm so Sorry i forgot to attach the png
duplicate Records.png
2018-11-06 12-02-44
Brian Hollander
If you used the Group By you only get the rows in your result you see on the left side (blue). So in the result you wont have duplicates...
2014-12-03 16-46-31
Andrew Tabata
Hi Ilham Rania, 

As Brian Hollander wrote, you have to group by the colums you want. Just look at your table and see which columns you need to group by, so the duplicates values would "merge".

Cheers
UserImage.jpg
Ilham Rania
Hi

yes i aleready used the Group by but i also have the duplicate records

Thanks
2014-12-03 16-46-31
Andrew Tabata
If you still have duplicate values, then you need  to group by another column. 
Down it's just an example to retrive values without dupplication by Group By
Ie: Imagine Persons Names and Districts and you want to retrieve only one line with a specific district and for a person name and count how many "Rania" are in the District A" It could happen that in the same district there is many persons with teh same first name, then you would make:

Select Distinct Person_Name, District
From Some_table
Where District = 'District A' and Person_name = 'Rania'
Group By District, Person_Name

Hope it helps


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