A = data.table(idxA = rep(1:5, 2), valueA = runif(10))
B = data.table(idxB = rep(4:8, 2), valueB = runif(10))
C = A[B, on = .(idxA < idxB), allow.cartesian = TRUE]
How can I get the column idxB in the joined table C, ie for C to have both idxA and idxB columns?