With Flink SQL, windows can only be applied to append-only streams. There’s no support for windows that might need to recalculate/update their results based on updates to the stream(s) fed into the windows.
That sort of windowing needs a different (and much more expensive) approach to managing window state. You could probably implement this using the DataStream windowing API, but it could get very complex, depending on the exact requirements. You could definitely build this using process functions.