Try bit masking http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html
MySQL: How to select from a binary field
Hello people :-)
I'm currently working on some Dataming tasks and i have a question realated to the use of the SQL-Statement where in mysql.
In my Database is a field, which contains binary keys.
F.e.: 0100101101
In a select I want to get all Datarows, where the key contains the decimal "4", this means every keys with this structure: xxxxxxxx1xx
with php and an array it would be really easy, but i consider about if it is possible to make a select-statement which would have a better performance compared to a php script.
my current idea is to check if the third place is a 1 or a 0, but i have no idea how to write this as an sql statement :-/
I hope you have a nice idea, because i'm running out of ideas :-(
Thanks :-)
Please or to participate in this conversation.