次のように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
)
エイリアステーブルで2番目の左結合を作成して、3番目の左結合で使用できるようにするにはどうすればよいですか?