title: mySQL SELECT rows where a specific bit of an integer is set
body: <p>i have to do a select query in a posting table where a specific bit of an integer is set.
  The integer represents a set of categories in a bitmask:
  E.g.</p>
  
  <pre><code>1 =&gt; health
  2 =&gt; marketing
  3 =&gt; personal
  4 =&gt; music
  5 =&gt; video
  6 =&gt; design
  7 =&gt; fashion
  8 =&gt; ......
  </code></pre>
  
  <p><strong>Data example:</strong></p>
  
  <pre><code>id | categories | title
  1  | 11         | bla bla
  2  | 48         | blabla, too
  </code></pre>
  
  <p>I need a mysql query that selects postings, that are marked with a specific category.
  Let's say "all video postings"
  This means i need a result set of postings where the 5th bit of the catgories column is set (e.g. 16,17,48 ....)</p>
  
  <pre><code>SELECT * FROM postings WHERE ....????
  </code></pre>
  
  <p>Any ideas ?</p>