Question

For example, I got following JSON from a URL

{ "time": "2014-05-10 06:23:36 UTC", 
  "values": [
    {
      "time_timetable_utc": "2014-05-10T06:25:00Z",
      "time_realtime_utc": null,
      "flags": ""
    },
    {
      "time_timetable_utc": "2014-05-10T06:45:00Z",
      "time_realtime_utc": null,
      "flags": ""
    },
  ]
}

This will work on YQL

select time from json where url="{url}"

It will return me only time field

{"time": "2014-05-10 06:23:36 UTC"}

But if I only want to get "values" array field with following

select values from json where url="{url}"

I will get this error message

Query syntax error(s) [line 1:7 expecting fields_or_star got 'values']

Just want to ask is that possible to select a JSON field whose name is a reserved Yahoo YQL keywords?

I know this will work

select * from json where url="{url}" and itemPath="json.values"

But is that possible to do it without using "itemPath" condition?

How to escape reserved word like "values" in YQL select?

Was it helpful?

Solution

Just want to ask is that possible to select a field names "values"?

No. (Sorry!)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top