Orientdb查询子

时间:2016-05-31 14:45:53

标签: sql orientdb orientdb-2.1

是否有方法使用Orientdb 2.1.11(文档数据库)来获取EmebeddedList

这是类结构

{
    "@class":"Quote",
    "number":"Q1",
    "details":[{
      "code":"123",
      "price":10
      },{
      "code":"456",
      "price":20
      }
    ]
},{
    "@class":"Quote",
    "number":"Q2",
    "details":[{
      "code":"789",
      "price":15
      },{
      "code":"951",
      "price":25
      }
    ]
}

我想要一个返回以下内容的查询:

number| code | price
------|------|------
Q1    | 123  | 10
Q1    | 456  | 20
Q2    | 789  | 15
Q2    | 951  | 25

1 个答案:

答案 0 :(得分:1)

我已经复制了你的结构

enter image description here

我已经使用了这个查询

select number, details.code as code, details.price as price from (select prop.number as number, prop.details as details from (select prop from test unwind prop) unwind details)

enter image description here

希望有所帮助