OrientDB 在子查询中使用 LET 值
OrientDB using LET values in subQuery
如何在 OrientDB SQL 子查询的 Where
子句中使用 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 语句中的日期验证无效。 subQuery 实际上是独立工作的。当用子查询的结果替换 $t.d
时,查询也能正常工作。
$t.d
是一个数组,因此您比较的是 createdDate.asLong() >= [1234599]
你必须这样做:createdDate.asLong() >= $t[0].d
如何在 OrientDB SQL 子查询的 Where
子句中使用 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 语句中的日期验证无效。 subQuery 实际上是独立工作的。当用子查询的结果替换 $t.d
时,查询也能正常工作。
$t.d
是一个数组,因此您比较的是 createdDate.asLong() >= [1234599]
你必须这样做:createdDate.asLong() >= $t[0].d