The internal length of a table's join columns must not exceed 1020 bytes. Join columns are the columns that are contained in a JOIN predicate.
Example
WHERE (S.A = T.V AND S.B < T.W)
The join columns of table S are columns S.A and S.B. The internal length of the join columns of S is the internal length of column S.A plus the internal length of column S.B. The internal length of the join columns of S must not exceed 1020 bytes.
Try to achieve the expected result by issuing several QUERY statements and creating tables as temporary results.