Fix SQL query broken by previous commit.