I was recently tasked with taking over a database that I have never seen before. The former developer loved to use binaries to store information in his database tables. It's really quite annoying, but it is what it is and I have absolutely no idea what I'm looking at here or how this works.
Here is an example below of a SQL statement:
SELECT feature_binary, feature_ID FROM table WHERE feature_binary & 2 = 2
Here is the result:
First off, how is the "feature_binary" (which is an INT in the table) derived from the feature_ID data? And two, what exactly is the code in the WHERE clause doing and how does it relate to values that have 258 or 514, for example.
Note, there is a "feature" table that feature_ID is (sort of) referencing, but the queries are using the "feature_binary" table instead.
Any help would greatly be appreciated.