在Orient SQL中使用BOTH时选择某些属性(字段)(Select certain properties (fields) when using BOTH in Orient SQL)

系统教程 行业动态 更新时间:2024-06-14 16:57:17
在Orient SQL中使用BOTH时选择某些属性(字段)(Select certain properties (fields) when using BOTH in Orient SQL)

使用OrientDB 2. *和OrientSQL。

我有一个简单的图表与类Users有许多属性(用户名,国家,宠物等)。 每个用户也有外向friends优势。 我想只选择与特定用户成为朋友的所有用户的username和country 。

我的查询到目前为止:

SELECT EXPAND( BOTH('friends') ) FROM users WHERE @rid = #12:0

为#12:0朋友返回完整的用户对象

我只想返回这些朋友的username和country 。

我错过了一些简单的事吗? 非常感激!

Using OrientDB 2.* with OrientSQL.

I have a simple graph with Class Users that has a number of properties (username, country, pets, etc). Each user also has outgoing friends edge. I want to select only the username and country from all users who are friends with a specific user.

My query so far:

SELECT EXPAND( BOTH('friends') ) FROM users WHERE @rid = #12:0

returns the full user objects for those who are friends of #12:0

I want only to return the username and country of those friends.

Am I missing something simple? Much appreciated!

最满意答案

您可以:

select expand(both('friends').include('username', 'country')) from #12:0

请注意,您应该:

select from #12:0

代替:

select from Users where @rid = #12:0

You can:

select expand(both('friends').include('username', 'country')) from #12:0

Note that you should:

select from #12:0

instead of:

select from Users where @rid = #12:0

更多推荐

本文发布于:2023-04-12 19:53:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/d621f17c303735ba2079aa0c1038e61b.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字段   属性   SQL   Orient   properties

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!