title: Left join to a table where values do not exist (and are not NULLs)
body: <p><strong>EDIT (SOLVED):</strong> A cross join. One of those joins you never use until you need it. Thanks for the help</p>
  
  <p><strong>Left table</strong>: TS , single field with values [1,2,...,365]. </p>
  
  <p><strong>Right table</strong>: PAYMENT with three fields (ID, TS, AMT)</p>
  
  <p>For each ID, I want to see 365 records from a left join of TS on PAYMENT. </p>
  
  <p>The problem is that "no value" is not the same as a NULL.</p>
  
  <p>If PAYMENT.TS does not exist for a certain value (e.g. PAYMENT.TS=4), then there is no value to join on and the left join does not return a row #4.</p>
  
  <p>I tried using NOT IN / NOT EXISTS as a condition, but this only treats the case where the right table has explicit NULLS and not the case where no value exists.</p>
  
  <p>How can I proceed? Thanks!</p>
  
  <p>(This is a DB2 system)</p>
  
  <hr>
  
  <pre><code>SELECT * FROM TS LEFT JOIN PAYMENT ON TS = PAYMENT.TS
  </code></pre>
  
  <hr>
  
  <p>TS TABLE:</p>
  
  <pre><code>|   TS   |  
  ----------
      1           
      2       
     ...        
     365       
  </code></pre>
  
  <p>PAYMENTS TABLE:</p>
  
  <pre><code>|   ID   |   TS   |    PMT  |
  -----------------------------
      1        1         70    
      1        2         20
      1        5         10 
      2        3         200
  </code></pre>
  
  <p>EXPECTED RESULT:</p>
  
  <pre><code>|   ID   |   TS   |    PMT  |
  -----------------------------
      1        1         70 
      1        2         20
      1        3         
      1        4         
      1        5         10
     ...      ...
      1       365  
  
      2        1 
      2        2 
      2        3         200    
     ...      ...
      2       365 
  </code></pre>
  
  <p>ACTUAL RESULT:</p>
  
  <pre><code>|   ID   |   TS   |    PMT  |
  -----------------------------
      1        1         70 
      1        2         20
      1        5         10
      2        3         200    
  </code></pre>