Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 233
Carol AndorMarten Liebster Avatar asked Dec 10 '16 05:12

Carol AndorMarten Liebster


1 Answers

What you want is:

SELECT VALUE food FROM food JOIN t in food.tags WHERE t.name = "oil"
like image 97
Larry Maccherone Avatar answered Oct 07 '22 07:10

Larry Maccherone