title: MySQL omitting rows a user has already seen from checking a "seen" table
body: <p>I'm trying to figure out <strong>how best to write a statement</strong> that omits returning rows (<code>maintable</code>) that a user (<code>uuid_user</code>) has already seen (<code>seentable</code>).</p>
  <ul>
  <li>Q: Should I have the &quot;seen&quot; table be a separate table for each user?</li>
  </ul>
  <p><strong>Currently, I have it as a single <code>seen</code> table for all users</strong></p>
  <p>Rows that a user has already seen are stored in <code>seentable</code> for each <code>uuid_user</code>. Here is a simplified version of my tables. <code>uuid</code> is used as the key to join. <code>uuid_user</code> identifies the particular user's seen rows.</p>
  <p>Not quite working:</p>
  <pre><code>SELECT * 
    FROM maintable m 
   LEFT JOIN seentable s 
      on m.uuid = s.uuid 
   WHERE s.uuid IS NULL and s.uuid_user = '[user]'
  </code></pre>
  <pre><code>maintable
  uuid (char36)
  lng,lat (POINT)
  timestamp (timestamp)
  
  seentable 
  uuid (char36)
  uuid_user (char36)
  timestamp (timestamp)
  </code></pre>