我有两个加入:
LEFT JOIN TransactionAmounts AS TAR ON T.orderID = TAR.orderID AND TAR.customerType = 1
LEFT JOIN TransactionAmounts AS TAA ON T.orderID = TAA.orderID AND TAA.customerType = 0
我如何才能替换这两个连接?为了提高性能
答案 0 :(得分:3)
您可以使用
column6,column7,column8
或者
LEFT JOIN TransactionAmounts AS TAR ON T.orderID = TAR.orderID AND TAP.customerType in(0, 1 )
检查执行计划