对于新的sql server版本,有以下功能 SHORTEST_PATH
. 我使用边表中的属性(或标签)来区分不同类型的连接。
不幸的是 SHORTEST_PATH
函数似乎不允许where条件中的任何属性(如果表被标记为path)
SELECT
l1.CommonName AS CommonName,
STRING_AGG(l2.CommonName, '->') WITHIN GROUP (GRAPH PATH) AS Verbindung,
LAST_VALUE(l2.CommonName) WITHIN GROUP (GRAPH PATH) AS LastNode
from object as l1,
connections for path as v,
object for path as l2
where match(SHORTEST_PATH( l1 (-(v)-> l2)+))
and l1.CommonName = 'jagdtWurst'
and v.label= 'hierarchie' <<--- This is not possible .... Error
有没有什么诀窍怎么做呢?
1条答案
按热度按时间von4xj4u1#
看起来可以在中使用子查询
from
条款。如