An INNER JOIN can add customer fields first, then WHERE filters the joined rows to one customer segment.
highlighted = computed this step
Orders input
Start with orders that carry customer keys.
Orders
Customers input
Customers maps matching customer keys to segments.
Customers
Join query
INNER JOIN adds customer segment for matching keys, then WHERE keeps retail rows.
JOIN then WHERE segment = retail
Joined output
Only the joined retail order remains.
retail joined rows