“'SELECT *' is only valid with a single input set.”

空扰寡人 提交于 2019-12-12 10:47:46

问题


Trying to learn the query syntax in the sandbox ( https://www.documentdb.com/sql/demo )

SELECT food.id FROM food JOIN t in food.tags WHERE t.name = "oil"

This works, but what if I want to get the entire document, so I tried

SELECT food.* FROM food JOIN t in food.tags  WHERE t.name = "oil"

and

SELECT * FROM food JOIN t in food.tags  WHERE t.name = "oil"

and get the error:

{
  "errors": [
    {
      "severity": "Error",
      "location": {
        "start": 7,
        "end": 8
      },
      "code": "SC2040",
      "message": "'SELECT *' is only valid with a single input set."
    }
  ]
}

How does one get the entire document back?


回答1:


What you want is:

SELECT VALUE food FROM food JOIN t in food.tags WHERE t.name = "oil"


来源:https://stackoverflow.com/questions/41072638/select-is-only-valid-with-a-single-input-set

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!