I need alittle help with a mysql query. I have 3 tables
x1 x2 x3
1 1 1
2 2 2
2 2 2
我有2人加入。
select distinct
x1.int1 as a,
x2.int1 as b,
x3.int1 as c
from
x1
JOIN
x2
JOIN
x3
but I would like to generate the cartesian product with the condition that the results
should contain just the just the 3 numbers from x1 (1,2,2)
in all orders and I don t know what condition to put in the query
it s a permutation simulation of three elements(1,2,2) result should be 1,2,2 2,1,2 2,2,1
增 编