converting mysql columns to bits in a single column
Use logical shifts &lt;&lt; plus a bitwise or | operation.

For example:

SELECT (col1&lt;&lt;16) | (col2&lt;&lt;15) | (col3&lt;&lt;14) | (col4&lt;&lt;13) ...

MySQL docs are here.