我想按如下方式创建 SQL 查询:
select *
from vwOrderRNI orni
left join vwOrderRN orn on orn.SysId in
(
select associatingid
from OrderRNAssociation
where AssociatedId = orni.SysId
and AssociationName = 'ORNItems'
)
left join vwPOrder po on po.SysId in
(
select AssociatingId
from PurchaseOAssociation
where AssociatedId = orn.SysId
and AssociationName = 'PO_OrderRequisitionNotes'
)
left join vwPOItem poi on poi.POrder =
(
-- above left join i want to take po.SysId which is filter because of left join
)
如何在别名表中进行第二个左连接,以便我可以在第三个左连接中使用它?