TransWikia.com

Perform SELECT using WHERE IN clause on JSON Object in MySQL

Database Administrators Asked by girish on October 28, 2021

I have a json column in MySQL which contains a list of items for eg.

"style": {"style1", "style2", "style3", "style4", "style5"}

I want to search all the rows which contain the styles I specify through an array like IN clause like WHERE style IN(["style1", "style3"])

So I want to get all the rows which will match the string items from array exactly like how the WHERE IN() clause works in MySQL.

Is there any workaround or easy way to get this working?

Please help.. Thanks

One Answer

I solve this problema using MySQL JSON_TABLE – Map a JSON object to a relational database table.

Cheers

Answered by Marwin Campos on October 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP