I have table like this below
Table A
ID name score
1 aaa 100
2 bbb 200
3 ccc 300
4 bbb 100
5 kkk 600
6 ccc 300
Now name bbb
and ccc
is duplicated so, I want to remove then and depict like this,
ID name score
1 aaa 100
2 bbb 200
3 ccc 300
5 kkk 600
I found out that django model doesn’t have groupby so, I guess need to use annotate
or distinct
So my idea is like this below,
MyModel.objects.annotate(Count('name'))
However it doesn’t work as I hope.
Any help or hint?
2