Ik zou JSON_CONTAINS
. gebruiken .. Controleer dbfiddle
(mariadb_10.4)
syntaxis is 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') = '[]'
Voor invoer 4 is