get data of db h2, and validity that does not enter the same value

hello can you help me, I want to validate 2 multiple data of list type, that when the user wants to enter value 1 and value 2 it is validated that it is not in the data bade h2.

please