chewie
chewie

Reputation: 569

MYSQL Json query

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.

Upvotes: 0

Views: 214

Answers (1)

chewie
chewie

Reputation: 569

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

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

Upvotes: 1

Related Questions