2015-08-31 31 views
0

如何在OrientDB SQL子查询中使用Where子句中的LET临时变量。OrientDB在子查询中使用LET值

这里是我试图使用它的上下文。

select *, $t.d from Currency 
    let $t = (select createdDate.asLong() as d from 13:1) 
where createdDate.asLong() >= $t.d and @rid <> #13:1 
order by createdDate ASC 

日期的where语句中的验证不起作用。子查询实际上是独立运作的。使用子查询的结果替换$t.d时,查询也可以正常工作。

回答

1

$t.d是一个数组,所以你喜欢createdDate.asLong() >= [1234599]

比较的东西你必须这样做:createdDate.asLong() >= $t[0].d