title: Select record if exist in one table, else select from another
body: <p>I'm writing a report for quotes. The quote table have a copy to track the change history, so every time someone change the quote table the old values are salved in this history table.</p>
  
  <p>I want to include a field in my report named Original Due Date, which will show what is the original due date for the quote. If there is a record in the history table, it should get the first due date from there. Otherwise it should get the due date from the original table.</p>
  
  <p>Here is some sample of the records I have in my tables.</p>
  
  <p>Table 1:</p>
  
  <pre><code>|ID | Order  | Due Date   |
  |1  | C1234  | 15/01/2000 |
  |2  | C1235  | 15/02/2000 |
  |3  | C1236  | 15/03/2000 |
  |4  | C1237  | 15/04/2000 |
  </code></pre>
  
  <p>History Table:</p>
  
  <pre><code>|ID | Order  | Due Date   |
  |1  | C1234  | 02/01/2000 |
  |2  | C1234  | 05/01/2000 |
  |3  | C1236  | 05/03/2000 |
  |4  | C1236  | 07/03/2000 |
  </code></pre>
  
  <p>Expected results:</p>
  
  <pre><code>|ID | Order  | Original Due Date   |
  |1  | C1234  | 02/01/2000          |
  |2  | C1235  | 15/02/2000          |
  |3  | C1236  | 05/03/2000          |
  |4  | C1237  | 15/04/2000          |
  </code></pre>
  
  <p>This is the code I've tried, which does not work because my subquery return more than 1 value.</p>
  
  <pre><code> select case when exists (select 1 from quoteheader qh inner join quoteheaderhistory qhh on QH.QH_RecordID = QHH.QH_RecordID)
          then (select QHH.QH_RFQ_Date from quoteheader qh inner join quoteheaderhistory qhh on QH.QH_RecordID = QHH.QH_RecordID)
          else QH.QH_RFQ_Date
          end,
      * from quoteheader qh inner join quoteheaderhistory qhh
            on QH.QH_RecordID = QHH.QH_RecordID
  </code></pre>