I have a MySQL database unfortunately used with Django 1.4.1. Distinct function is only working for POSTGRESQL if i get it right.
I have to make a distinct query consist of multiple values while only distinct one,
Like; This one works for POSTGRE but not with MYSQL, I get the following error;
DISTINCT ON fields is not supported by this database backend
staff = Staff.objects.order_by('person__full_name').distinct('person__full_name')
Then I tried
staff = Staff.objects.values('person__full_name','staff_job_categories').distinct().order_by('person__full_name')
But I do not get distinct values because i get also the staff job categories. But when I dont contain it I could not get it as array.
Any idea ?