Hello! I'm pretty new to SQL and I'm trying to fi...
# sql
n
Hello! I'm pretty new to SQL and I'm trying to figure out how to select a value from a nested JSON object and struggling to find out how to do so (unless my googling skills just suck) Below is an example of what I'm trying to do, I want to figure out how to select baz as I want to sort by this value
Copy code
json
{
  "foo": {
    "bar": {
      "baz": 50
    },
    "something": null
  }
}
I figured it out, if anyone was curious how it was just: CAST(foo-> 'bar' -> 'baz' ->> _query as INTEGER) as value