I have a database having a filed myfield containing json string:["2","4","1","6"] OR ["1"] . I want to make a filter for this filed and was thinking to query it with:
SELECT id FROM table_name WHERE myfield = '5' -> this return can not echo id because ["2","4","1","6"] does not have the value 5.
SELECT id FROM table_name WHERE myfield = '1' -> return can echo id-> because -> in json string on filed myfield have the value 1.
how can fix it? what do i do?
I tried as but it don't work for me:
SELECT id FROM table_name WHERE myfield = '1'