-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aggregate functions are not allowed in JOIN conditions. ArrayAgg function in CTE join ON clause #94
Comments
The code snippet appears to redefine a_query = A.objects.annotate(b_ids=ArrayAgg("b__id", distinct=True))
q = (
cte.join(
a_query,
b_ids__overlap=... |
@millerdev Yeah... my bad. It was a typo. A small update. |
Django 4.2
django-cte 1.3.3
postgres 12
There is an SQL query that is needed to be performed via CTE in Django:
django-cte results to this query:
It does not use an alias
b_ids
for the array_agg column.Django code:
The text was updated successfully, but these errors were encountered: