I have a table consists of 3 JSON fields and each of them has data in the format like [1,2,3,4]
. I want to find the difference (the elements which are in one field that is not in another field) between any of the two JSON fields using MySQL query (by only using queries).
For example:
field 1 : [1,2,3,4]
field 2 : [1,4]
So the result should be like [2,3]
I am looking for a solution that can be implemented inside a trigger. Please comment if any more details required. Thanks.