I have a table that is filled with a variety of "masks" such at this:
Type Mask1 Mask2 Mask3
0 fff fff ff
1 aff fff ff
2 aff fff 92
3 001 fff 00
And basically I want to query the database and see if a particular query matches, say a00-111-12.
Anywhere there is an f (this is all in hex) I want to say there is a match.
So I take the value a00-111-12 and it should match with rows 0 and 1 but not 2 and 3 because in row 0, all f's appear and thus a value AND'd with them would result in that same value. BUT, AND-ing does not work since if testing with row 2, Mask3 column value 92 AND'd with 12 results in 12, however I don't want that row to be a match.
I find this a difficult question to ask, it may not be possible with a few MySQL Queries but I want to avoid importing the entire table into PHP and then finding the correct rows from there.
An idea of a query would be:
SELECT * FROM TABLE WHERE Mask1 = a00 AND Mask2 = 111 AND ...
However some operation would need to be done on either Mask1, 2, 3 or the value being sent to the query.
The end goal is to get the Type from the matching rows. If you need more information please ask.