If you’re getting error number 4123 that reads “Window element in OVER clause can not also be specified in WINDOW clause” in SQL Server, it’s probably because you’re referring to a named window with the same clause that’s in the named window.
When we use the OVER
clause to refer to a named window in SQL Server, we can’t include a clause that’s also present in the named window.
To fix the issue, remove one of the clauses – either the one in the OVER
clause or the one in the named window.