Created
October 23, 2018 06:50
-
-
Save maxtortime/6c81e60a00d03a08bec0b6465dd2738e to your computer and use it in GitHub Desktop.
filter by annotated window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qs = ConditionOccurrence.objects.filter( | |
condition_concept_id__in=ConceptSet.objects.get(pk=1198).concepts.values( | |
'pk')).annotate(ordinal=Window(expression=RowNumber(), order_by=F( | |
'condition_start_date').asc(), partition_by=[F('person_id')])).filter(ordinal=1) | |
... | |
django.db.utils.NotSupportedError: Window is disallowed in the filter clause. |
Author
maxtortime
commented
Oct 23, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment