Add appopriate framing clause

pull/1076/head
Erik Johnston 2016-09-07 14:39:01 +01:00
parent d25c20ccbe
commit fadb01551a
1 changed files with 1 additions and 0 deletions

View File

@ -324,6 +324,7 @@ class StateStore(SQLBaseStore):
)
SELECT type, state_key, last_value(event_id) OVER (
PARTITION BY type, state_key ORDER BY state_group ASC
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
) AS event_id FROM state_groups_state
WHERE state_group IN (
SELECT state_group FROM state