OrientDB:如何使用选择查询更新列 [英] OrientDB: How to update column using select query
本文介绍了OrientDB:如何使用选择查询更新列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用以下内容更新表中的列:
I need to update a column in table using following:
update Table1 set name = (select productName from Table2 where
@rid=$parent.$current.productid)
Query 工作正常,但不是 name 查询以[productname]"格式存储值.
Query works fine but instead of name query stores value in "[productname]" format.
我已经阅读了 orientdb 文档,我猜选择查询以集合格式返回结果.所以我已经尝试过以下功能
I have read orientdb documentation, I guess select query returns result in collection format. so I have already tried following functions
- 获取(1)
- 第一个()
- [0] 等(我绝望的尝试:)
提前致谢.
推荐答案
我尝试搜索但没有得到任何干净的答案,但我进行了以下更改对我有用&完成工作:)
I tried searching but did not get any clean ans, but i making following change worked for me & got the job done :)
update Table1 set name=(select productname from Table2 where
@rid=$parent.$current.productid),
name= name.replace("\[","").replace("\]","")
希望这可以为某人节省时间.
Hope this saves time for someone.
这篇关于OrientDB:如何使用选择查询更新列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文