fix syntax in scope SQL.