Use last_columns to prevent query errors on where conditions