﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30104	Need filtering by Window expression	Farid	nobody	"I use Row_Number function with WIndow expression. And i need to filter only second rows.

{{{
History.objects.annotate(row=Window(expression=RowNumber(), partition_by=[F('ad_id')], order_by=F('updated_at').desc())).filter(row=2)
}}}

But this exception raised:

{{{
django.db.utils.NotSupportedError: Window is disallowed in the filter clause.
}}}

Why Window is disallowed in the filter clause? Is there other way to do this?"	Uncategorized	closed	Database layer (models, ORM)	2.1	Normal	invalid	orm, window, row_number, filter	Farid	Unreviewed	0	0	0	0	1	0
