Search inside per-row arrays.
Section: Update and expand JSON
Join against JSON array values in a column
sql
sql
SELECT a.id, je.value AS role
FROM accounts a,
json_each(a.roles_json) AS je
WHERE je.value = 'admin';Explanation
Great for analytics and migrations, though highly queried JSON fields are often better normalized or indexed via generated columns.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Update and expand JSON