Fix clear query for other database backends