```sql
select 1 from numbers(10) intersect select 1 from numbers(10)

SELECT 1
FROM numbers(10)
INTERSECT
SELECT 1
FROM numbers(10)

Query id: 9f2d11c5-269c-41dc-9b4c-8f1423aafcc7

┌─1─┐
│ 1 │
│ 1 │
│ 1 │
│ 1 │
│ 1 │
│ 1 │
│ 1 │
│ 1 │
└───┘

8 rows in set. Elapsed: 0.002 sec. 
```
else if (inputs.back().isFinished())
    {
        finished_second_input = true;
    }
    if (!has_input)
    {
        InputPort & input = finished_second_input ? inputs.front() : inputs.back();
        input.setNeeded();
        if (!input.hasData())
            return Status::NeedData;
        current_input_chunk = input.pull();
        has_input = true;
    }
    return Status::Ready;
}
void IntersectOrExceptTransform::work()
{
    if (!finished_second_input)
    {
        accumulate(std::move(current_input_chunk));
    }
    else
    {
        filter(current_input_chunk);
        current_output_chunk = std::move(current_input_chunk);
    }
    has_input = false;
}
template <typename Method>
void IntersectOrExceptTransform::addToSet(Method & method, const ColumnRawPtrs & columns, size_t rows, SetVariants & variants) const