title: Join if not exists
body: <p>I encountered following problem:</p>
  
  <p>I have a long query (let's call it query "Z" ) that includes lots of joins and subqueries. It ouputs two columns:</p>
  
  <ul>
  <li>A: item</li>
  <li>B: Integer attribute, range guaranteed to be 1-10</li>
  </ul>
  
  <p>I want to join from table X items (column A) that are not present as output of query Z and give them an arbitrary attribute value 10 (column B).</p>
  
  <p>I tried creating subquery with inner subquery uisng not exists but that requires copying my original query inside and takes a lot of time (I didn't even manage to execute it).</p>
  
  <p>Any suggestions? Thanks</p>