如何让orientDB避免空值 [英] How to make orientDB avoid null

查看:53
本文介绍了如何让orientDB避免空值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我执行下面的代码时,

When I execute code below,

select expand(distinct(@rid)) from (
  select from V
  where @rid = 'number not exist'
)

它返回

OCommandExecutionException:
     expression item '@rid' cannot be resolved because current record is NULL

这个内部选择只是为了测试,它不返回任何记录.

This inside select is just for test and it returns no record.

如果 select 没有返回记录,我希望返回 nullexpand(distinct(@rid)) 如果选择返回一些 @rid.

I want null to be returned if select returns no record and expand(distinct(@rid)) if select returns some @rid.

环境是 OrientDB 2.1.5,它发生在控制台和工作室.

The environment is OrientDB 2.1.5 and it occurs both in console and studio.

谢谢!

推荐答案

您的查询在 2.1.7 版中正常工作:

Your query works correctly in version 2.1.7:

OrientDB console v.2.1.7-SNAPSHOT (build 4) www.orientdb.com
...
orientdb> connect ...

orientdb {db=demo}> select expand(distinct(@rid)) from (select from V where @rid = 'number not exist')

0 item(s) found. Query executed in 0.076 sec(s).

这篇关于如何让orientDB避免空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆