title: add view state from other table to select result
body: <p>I have two tables <code>reports</code> &amp; <code>viewedids</code><br>
  the first one stores data and the second one stores user IDs that viewed data:  </p>
  
  <p>viewedids:  </p>
  
  <pre><code>+-------+------+
  |  uid  | rid  |
  +-------+------+
  |   2   |   5  |
  +-------+------+
  </code></pre>
  
  <p>each (<code>uid</code>,<code>rid</code>) means the <code>uid</code> has viewd <code>rid</code>  </p>
  
  <p>I want to select <code>*</code> from <code>reports</code> table and add view state (<code>0</code> or <code>1</code>) for current user to it. (A JOIN statement)<br>
  How can I do this?</p>