Skip to content
Advertisement

How to search JSON data associative array mysql 5.5

I have stored JSON associative array data in the column of the table in MySQL 5.5. I want to search in JSON at one specific array key with key and value my JSON structure :

So for search by Key Value, I have this query :

It is working fine but my problem is that I can not select Interface_1 and search MACAddress on it. I want to select Interface_1 and search MACAddress on it.

Advertisement

Answer

You can include the Interface_1 object key into your regular expression, searching from that point but not past any } (end of object) character for the MAC address:

Demo on dbfiddle

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement