I need a sample after I make a join of two tables, something like:
SELECT *
from
A left join B
on A.col=B.col
sample 1000000
The problem is that A and B are huge (over 3 billion rows) and I run out of spool space when I try a join.
Is there a way to do the join after the sample, so that it is joining smaller tables (for example chose 10,000,000 samples from A and from B, inner join them, and select 1,000,000 from the join, hoping I do get at least 1,000,000 rows?)
P.S. I am using teradata