Не знаю, как объединить MATCH и JOIN в SQL Graph Query.Ошибка говорит: сообщение 4104, уровень 16, состояние 1, многокомпонентный идентификатор «P1.IdBL» не может быть связан (тот, что в предложении соединения).
SELECT
P1.IDBL,
P1.NodeName,
COUNT(P2.NodeName) WITHIN GROUP (GRAPH PATH) AS [Depth],
STRING_AGG(P2.NodeName,'/') WITHIN GROUP (GRAPH PATH) AS [Assembly],
LAST_VALUE(P2.IdBL) WITHIN GROUP (GRAPH PATH) AS [Final ID BL],
LAST_VALUE(P2.LgnBL) WITHIN GROUP (GRAPH PATH) AS [Final Lgn BL],
LAST_VALUE(P2.IdOF) WITHIN GROUP (GRAPH PATH) AS [Final ID OF],
LAST_VALUE(P2.IdBE) WITHIN GROUP (GRAPH PATH) AS [Final ID BE],
LAST_VALUE(P2.LgnBE) WITHIN GROUP (GRAPH PATH) AS [Final Lgn BE]
FROM
ALL_NODES P1,
ALL_NODES FOR PATH P2,
ALL_EDGES FOR PATH E
JOIN BL_LIVRAISON AS L ON L.BL_IdBL=P1.IdBL
WHERE MATCH(SHORTEST_PATH(P1(-(E)->P2)+))
AND BL_Date>=@DateMin AND
10*1000*YEAR(BL_Date) + 100*MONTH(BL_Date) + DAY(BL_Date) <= 10*1000*YEAR(@DateMax) + 100*MONTH(@DateMax) + DAY(@DateMax);