title: SQL query when inner join value exists or doesn't
body: <p>I have the following query:</p>
  
  <pre><code>select 
      case when jp.IntValue = 0 then 'N' else 'Y' end 'Enabled',
      j.LastChange 'Last Changed',
      90 'Lookback History Days',
      max(h.StartTime) 'Last Run',
      j.JobName 'Job Name' 
  from 
      Job j
  inner join 
      JobProperty jp on jp.JobId = j.JobId and jp.PropertyId = 397
  inner join 
      History h on h.JobId = j.JobId
  group by 
      jp.IntValue, j.LastChange, j.JobName
  </code></pre>
  
  <p>What I want to be able to do is expand it like this:</p>
  
  <pre><code>select  
      case when (jp.IntValue = 0 or jp.IntValue not exists) then 'N' else 'Y' end 'Enabled',
      j.LastChange 'Last Changed',
      90 'Lookback History Days',
      max(h.StartTime) 'Last Run',
      j.JobName 'Job Name' 
  from 
      Job j
  full outer join 
      JobProperty jp on jp.JobId = j.JobId and jp.PropertyId = 397
  inner join 
      History h on h.JobId = j.JobId
  group by 
      jp.IntValue, j.LastChange, j.JobName
  </code></pre>
  
  <p>but I can't seem to make it work.</p>
  
  <p>Essentially I want to join the table, but if the table can't join on the FK I want to still make note of the Job.</p>