DEV Community

Tim Nguyen
Tim Nguyen

Posted on β€’ Edited on

MySQL syntaxes

What

πŸ‘Ž JSON_UNQUOTE + JSON_EXTRACT vs πŸ‘ ->>



SELECT JSON_UNQUOTE(JSON_EXTRACT(metadata, 'field')) πŸ‘Ž
SELECT metadata->>'$.field' πŸ‘

Enter fullscreen mode Exit fullscreen mode




Why it matters?

JSON_EXTRACT vs -> only return the json result
JSON_UNQUOTE + JSON_EXTRACT vs ->> return the parsed result (you can think of the JSON.parse method in JS)

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay