Fix syntax error in SQL

Syntax error was introduced in last merge.