On Wed, 2008-11-19 at 15:41 -0800, Apaar Trivedi wrote: [...] > But how about at least introducing some way to suppress the order_by > column being added to the select fields? This way postgres is still > supported, and mysql distinct will work as well.
I'm strongly against this. We should be following correct SQL practices and SQL requires the ordering columns in the select list (the output columns). This is actually a *good* thing, too. If you're ordering by something that has multiple entries for a given set of output columns (output columns without the ordering columns, in this case), there's actually no correct answer when you add a distinct() qualifier, since there's no well-defined choice for which of the many possible orderings you choose in that case -- the same result tuple could appear first, least of somewhere in the middle, purely based on which completely arbitrary choice is made. Thus, the behaviour you're asking for means ordering is not a well-defined operation. As much as possible, Django provides a uniform interface over databases and, in this case, MySQL is doing something that we really shouldn't be encouraging, so special-casing it would not be encouraging best practices. Hopefully, MySQL will fix their bug one day. That's the way to resolve this. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
