Jeg ville bruge JSON_CONTAINS
.. Tjek dbfiddle
(mariadb_10.4)
syntaks er JSON_CONTAINS(target, candidate[, path])
SELECT
*
FROM
`student`
WHERE
JSON_CONTAINS(JSON_EXTRACT(`val`, '$.stdran'), '1')
OR JSON_EXTRACT(`val`, '$.stdran') IS NULL
OR JSON_EXTRACT(`val`, '$.stdran') = '[]'
For input 4 er