By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
version() |
---|
5.7.29 |
id | references |
---|---|
1 | "[1,3]" |
2 | "[2,3]" |
id | name |
---|---|
1 | item_1 |
2 | item_2 |
3 | item_3 |
references |
---|
"[1,3]" |
JSON_SEARCH((select `references` from table_a where id=1), 'one', '3') |
---|
null |
JSON_SEARCH('[1,3]', 'one', 1) |
---|
null |
JSON_SEARCH('"[1,3]"', 'one', 1) |
---|
null |
JSON_SEARCH('["1","3"]', 'one', 1) |
---|
"$[0]" |
id | references | checking | valid_JSON |
---|---|---|---|
1 | "[1,3]" | 1 | ["1","3"] |
2 | "[2,3]" | 1 | ["2","3"] |
id | name |
---|---|
1 | item_1 |
3 | item_3 |