title: MySQL value 0 or 1 if row exists in other table or not
body: <p>Searched StackOverflow for a while, and I did't find the an answer I can use, so here is my question:</p>
  
  <p>I have a table called "uploads" where I store information about all uploaded images on the site.</p>
  
  <p>Then I have another table called "gallery". If an entry in "uploads" (col id) exists in "gallery" (col file), the uploaded file is unlocked to the gallery, if an entry in "uploads" is not in "gallery" it's locked.</p>
  
  <p>If I use a normal JOIN, all entries in "uploads" that are not in the "gallery" table are missing.</p>
  
  <p>I want something similar to this:</p>
  
  <pre><code>SELECT [some other properties], (IF entry exists in gallery then 1 else 0) AS unlocked FROM ... WHERE ...
  </code></pre>