【问题标题】:OrientDB: avoid returning to the same node in OSql queryOrientDB:避免在 OSql 查询中返回同一节点
【发布时间】:2015-12-09 10:17:30
【问题描述】:

哦! 我正在尝试在 OSql 中编写 in().out() 查询,但我想避免返回到起始节点,例如在图中 e0 <- c0 -> e1 我想从 e0 转到 e1 而不是从e0 再次到 e0。 请注意,我不知道目标节点的 RID,并且可能有多个节点连接到 c0,我希望将它们包含在我的结果集中。

我尝试了以下查询的许多变体,但均未成功。

SELECT $other
FROM Employee 
LET $other = (
    SELECT in('Involves').out('Involves').email as mail 
    FROM $parent.$current 
    WHERE $current <> $parent.$current)
WHERE nt_account = 'e0'

有人知道怎么做吗?

【问题讨论】:

    标签: orientdb


    【解决方案1】:

    试试这个查询

        SELECT $other.mail
        FROM Employee 
        LET $other = ( select from (SELECT in('Involves').out('Involves').email as mail FROM $parent.$current unwind mail) where name<>$parent.$current.email )
    

    【讨论】:

      猜你喜欢
      • 2016-02-12
      • 1970-01-01
      • 1970-01-01
      • 2018-09-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多