I have a table Watchlist
that contains a number of players and a flag to idenfity their offenses. I want to implement the flag as a bitmask
. However, to catch wrong input at an early stage, I would like to check the bitmask against the table Watchlist_Flags
before the value is set.
Basically, I'm looking for an SQL query to verify that the about-to-be set bitmask flag is indeed composed of, and ONLY of, flag IDs present in the table Watchlist_Flags
Is it possible to implement this on an SQL level or do I need to deal with this in the final software?