Fix wrong SQL