我有这种形式的两个表:两个左外连接
库存:
Units InDate OutDate
1000 11/4 12/4
2000 13/4 14/4
价格:
Date Price
11/4 5
12/4 4
13/4 6
14/4 7
我想建立如下表:
Units InDate OutDate InPrice OutPrice
1000 11/4 12/4 5 4
2000 13/4 14/4 6 7
我以为我应该使用类似于:
Select *
FROM Inventory
LEFT OUTER JOIN Prices ON Inventory.InDate = Prices.Date
LEFT OUTER JOIN Prices ON Inventory.OutDate = Prices.Date
但是第二个OUTER JOIN似乎把事情弄糟了。
我该如何达到这个结果?