I am designing a data structure and want to know if I am missing something doing it this way.
Let's say I have a DAY column of type int.
1 : Monday
2 : Tuesday
4 : Wednesday
8 : Thursday
16 : Friday
32 : Saturday
64 : Sunday
If I wanted to store Monday and Friday, I would enter 17 in the DAY column. If I wanted to store Tuesday and Wednesday, I would enter 6, etc.
Is this a valid way to store data. What the query would look like if I wanted to choose where the entry contained Saturday and any change of days or Saturday, and not Wednesday. Is it possible? Will it be fast?
What is called this concept?
source
share