0

I have a JSON array of objects in a MySQL table that I am trying to see if there is a way to query and just pull the data. For example.

JSON Array Object

email_address_dump
[{"value":"[email protected]","type":"personal"},{"value":"[email protected]","type":"personal"},{"value":"[email protected]","type":"personal"}]

is there a way to query out just the email address? so that the results can be something like this?

[email protected], [email protected], [email protected]

I am not trying to search within the column, I know that with JSON Obtains you can use a where clause, this is more of a JSON Extract.

2
  • Does this answer your question? How to search JSON data in MySQL? Commented Aug 18, 2021 at 9:05
  • @JohnHC no, I am not trying to search but to extract the data. I think I found the answer by doing JSON Extract. Commented Aug 18, 2021 at 9:06

1 Answer 1

1

I was able to solve this by using JSON Extract from MySQL.

json_extract(c.email_address_dump, ''$[*].value') as EmailAddressArray,

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.