Hi Everyone, I have a query that I have been working. I have tried everything but not been able to make it work. Any suggestions would be great. Here is the plain mysql Query which I want to get using ORM.
Select * from tablename WHERE country='Australia' Group by concat('Email','Name') order by addeddate DESC
Anything added to .Values(‘HERE’) are added on group by
leads = leads.filter(country='Australia') leads.annotate(person=Concat('email', 'name')).values_list('person').annotate(countPer=Count('person')).order_by('countPer')
The query returns correct number of results by removing duplicates, however, any field added to select gets added to group by which I dont want. Any working example would be a great help.