#24367: ORA-00918 (column ambiguously defined) when using a combination of slicing, distinct, and order_by -------------------------------------+------------------------------------- Reporter: skoot | Owner: nobody Type: Bug | Status: closed Component: Database layer | Version: 1.7 (models, ORM) | Severity: Normal | Resolution: fixed Keywords: ORA-00918 oracle | Triage Stage: queryset | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Kishor Pawar): Hey Simon, I got what you are saying. I see now what I missed. Also , thank you for improvisation tips. I will update you with results of your suggestion. Replying to [comment:7 Simon Charette]: > Hey Kishor, could you try reproducing without using `extra`? I suspect this is the origin of your issue here as `id` could be ambiguous in your subquery's context. > > The `sysdate - (schedule_frequency/1440)` could be replaced by something along `schedule_next_run_time__gt=(Func(template='sysdate') - (F('schedule_frequency')/1440))` and the `owner_id IN` part by `owner_id__in=...`. > > I'll reset this ticket as fixed because while you have the same symptoms as the initial report (`ORA-00918 (column ambiguously defined)`) you are not using `slicing`, `distinct`, or `order_by` which is what this ticket is about. > > If you manage to reproduce a similar failure without using `extra()` please submit a new ticket with reproduction steps. -- Ticket URL: <https://code.djangoproject.com/ticket/24367#comment:8> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/063.67f74d1ff081cd4b4f72700f10524d76%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.