Fix windowing support for non-uppercased SELECT queries