converting mysql columns to bits in a single column I have a mySQL table with multiple columns (tinyint) with 0 or 1 values

I want to convert all these values into bits in a single integer column
So a column named column1 will go to MSB another column will set 2nd bit etc...

How do I do it?
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.