SQL fix attempt #2