Can anybody help me to solve this one case study, I’m new to sql & already googling for hours but can’t get any solution, yet.
Data: https://docs.google.com/spreadsheets/d/1aF4XeMv0Jm5_JZWmJ8_ysuev4LXKul4ydvYWBvxoRJ4/edit
Question: Which ‘location’ who got the most ‘5’ traffic level?
I already tried this query:
SELECT * FROM SampleData WHERE level = 5
The problem is: I must get the ‘location’ from geometry column with json like value (multilinestring & linestring). Example:
{'type': 'MultiLineString', 'coordinates': [[[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]], [[107.608784, -6.921363], [107.608979, -6.919696]]]}
Can anybody show me the query I should run? Only using sql if possible