0
I am a database novice and am participating in an Oracle-SQL project where I need to create a flags selection filter in a column that stores flags as active or not from the position of each binary number character, which apparently is called bit flag.
For example:
In a hypothetical situation of 4 flags, the column Flag store the numbers like this:
11, for active flags 1 and 2;
1100, for flags 3 and 4 active;
1111, for the case of all active flags;
0, for no active flag;
Through SQL (Oracle), how can I manipulate these numbers in order to know, for example, if flag 3 is active, bearing in mind that other flags may be active and that this table has a lot of elements to go through?
Wouldn’t it be better to do by position ? 0010 , 3 active , 1101 1,2 and 4 active ? But it would be better to normalize this, see Normal Forms of Database.
– Motta
Your suggestion makes perfect sense, but the problem is I can’t make any changes at the bank.
– Gustavo Delgado