In this article
- How JSON_TABLE works
- Sample setup
- Example 1: flatten simple fields into columns
- Example 2: turn a JSON array into rows with NESTED PATH
- Example 3: handle optional fields
- Example 4: aggregate values from the array
- Example 5: catch bad data that becomes NULL silently
- Example 6: return a whole array with FORMAT JSON
- Example 7: hide the JSON behind a view
- Common mistakes
- Performance tips
- Frequently asked questions
- Summary
JSON_TABLE turns JSON stored in a column into ordinary rows and columns, so you can query it with normal SQL. You put it in the FROM clause, give it a row path such as '