Check if MYSQL JSON array doesn’t contain a value
14 September 2023 (Updated 27 April 2025)
Suppose you have a table like this:

And you want to find all the records where user_types
doesn’t contain the entry "CLIENT"
. You can do this with the below query:
SELECT *
FROM user
WHERE NOT JSON_CONTAINS(user_types, '"CLIENT"')
Tagged:
SQL recipes
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment