Extended grammar for views with a where clause
Optimized order by further (removal of constant expression and cases that all have the same result expr)