本文介绍了“"SELECT *"仅对单个输入集有效."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在沙箱中学习查询语法( https://www.documentdb.com/sql/演示)

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"

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

并得到错误:

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

如何拿回整个文档?

推荐答案

您想要的是:

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

这篇关于“"SELECT *"仅对单个输入集有效."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 03:22