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":"a123@yahoo.com","type":"personal"},{"value":"all123@hotmail.com","type":"personal"},{"value":"car_sq5@indeedemail.com","type":"personal"}]

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

a123@yahoo.com, all123@hotmail.com, car_sq5@indeedemail.com

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.

chewie
  • 529
  • 4
  • 17
  • Does this answer your question? [How to search JSON data in MySQL?](https://stackoverflow.com/questions/30411210/how-to-search-json-data-in-mysql) – JohnHC Aug 18 '21 at 09:05
  • @JohnHC no, I am not trying to search but to extract the data. I think I found the answer by doing JSON Extract. – chewie Aug 18 '21 at 09:06

1 Answers1

1

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

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

chewie
  • 529
  • 4
  • 17