On Tue, Feb 17, 2009 at 5:01 PM, Russell Keith-Magee <[email protected]> wrote: > Out of interest - where does Oracle fall on this one? Can you use > aliases in a HAVING or ORDER BY?
Oracle only allows aliases in the ORDER BY clause. > >> If there are no concerns or potential gotchas with this approach, then >> I'll go ahead and commit this in a few days. > > My only major concern would be any potential performance hit from > double-computing the extra clause. Alex's suggestion to parameterize > this in the connection ops backend sounds like a good idea to me. > However, rather than just defining a boolean feature flag, my > preference would be to define a 'expand_extra()' function (or similar > - bikeshed builder gets to choose the colour) on the ops backend which > just returns the alias in the default case, but returns the full > expression under Oracle. I should probably do the same for alias usage > in HAVING/ORDER_BY clauses. That sounds like a good idea to me. I've already found one bug in my patch, which is that I didn't account for the duplication of extra select_params into the group by clause. Since we currently assume the group by clause has no params, fixing that will already be non-trivial. Regards, Ian --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
