I am trying to fetch the data from the database where the value is inserted in JSON format, I read the various threads available online but these all are not worked and match the query or bit tough to implement for me as a beginner. Please help is this possible to fetch the data if the saving this formate in DB though MySQL query?
I am trying to do this from last 2 days but all functions and login was not worked. Please help.
| ID | log_in |
|---|---|
| 1 | [{"in_dt":"2020-01-01","in_by":namehere}] |
| 2 | [{"in_dt":"2020-01-01","in_by":namehere}] |
| 3 | [{"in_dt":"2020-01-02","in_by":namehere}] |
| 4 | [{"in_dt":"2020-01-05","in_by":namehere}] |
what I am trying..
SELECT *
FROM `table`
WHERE DATE_FORMAT(JSON.parse(`log_in`.`in_dt`,'%Y-%m-%d'))
BETWEEN '2020-01-01' AND '2020-01-05'
but it not working..
namehereis just a representation but not a real value as not being quoted, isn't it?log_incolumn,VARCHARorJSON?