查詢到的用法如下
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
實測,至少在某些版本中,不太好使,臨時表還是會生成多次
如果臨時表中有一些隨機元素,幾次生成的還是會不同
參考文獻:
https://www.cnblogs.com/30go/p/10116815.html