My MySQL table contain json column academics.
Table values look like this :
id academics
--------------------------------------------------------
100 ["CBSE-Afternoon-12-A","CBSE-Morning-12-B"]
200 ["CBSE-Afternoon-12-C","CBSE-Morning-12-D"]
300 ["CBSE-Afternoon-12-E","CBSE-Afternoon-12-F"]
I have to find the id from the above table based on the search key:
CBSE-Morning-12 & CBSE-Afternoon-12
I have tried the below query
SELECT id
FROM ACADEMIC_TABLE
WHERE JSON_SEARCH(academics, 'all', 'CBSE-Morning-12%') IS NOT NULL
it returns id: 100,200 correctly.
But I need to search with two keywords like condition in JSON
[CBSE-Morning-12 & CBSE-Afternoon-12 ] and return id 100,200,300
Please help me