Fix query syntax