the simple table structure is as follows
< table > < thead > < tr > < th > ID < / th > < th > TypeID < / th > < / tr > < / thead > < tbody > < tr > < td > 1 < / td > < td > [1,2] < / td > < / tr > < tr > < td > 2 < / td > < td > [2,3] < / td > < / tr > < / tbody > < / table >TypeID is of type Json
how do I find all the data that TypeID
contains 2
?
- the official tutorial does not demonstrate how to filter in top-level elements, only filtering child elements
-
SELECT * FROM module WHERE JSON_EXTRACT (module.TypeID,"$[*]") = 2;
has no effect