Use the following query to the
with tmp0 as ( select a, b, c from test0 ), tmp1 as( select a, b, c from test1 ) select db0.a, db1.a, db2.a from tmp0 db0 left join tmp0 db1 on db0.b = db1.b left join tmp1 db2 on db0.b = db2.b
Measured, at least in some versions, not working, or temporary tables will generate many times
If you have some random elements in a temporary table, or will generate several different
references:
https://www.cnblogs.com/30go/p/10116815.html