title: Return SQL table in sequence, duplicates and all.
body: <p>This is seemingly a trivial question on SQL but one that has frustrated me for days. Suppose I have a SQL table on currency rates which I am trying to extract. The query I am trying to pass is: </p>
  
  <pre><code>SELECT AsAtDate, FromCurrencyCode, ToCurrencyCode, Value 
  from tblFX
  where FromCurrencyCode = 'USD'
  and ToCurrencyCode in ('HKD', 'HKD', 'EUR', 'HKD', 'GBP','EUR')
  and AsAtDate = '2018-04-24'
  </code></pre>
  
  <p>I want the outcome as a table with the exact sequence as the <strong><em>ToCurrencyCode</em></strong> I pass in. However, SQL always return the distinct values by default. </p>
  
  <pre><code>SQL table output: 
  AsAtDate    FromCurrencyCode    ToCurrencyCode  Value
  2018-04-24        USD                 EUR      0.818699
  2018-04-24        USD                 GBP      0.716101
  2018-04-24        USD                 HKD      7.846950
  </code></pre>
  
  <p>There are some solutions that returns only the duplicates in SQL but what I want is the table return in the exact sequence as the list I passed in, inclusive of both unique and duplicates fields. Is there a way to do this in SQL? Thanks guys.  </p>
  
  <pre><code>Desired SQL table output: 
  AsAtDate    FromCurrencyCode    ToCurrencyCode  Value
  2018-04-24        USD               HKD         7.846950
  2018-04-24        USD               HKD         7.846950
  2018-04-24        USD               EUR         0.818699
  2018-04-24        USD               HKD         7.846950
  2018-04-24        USD               GBP         0.716101
  2018-04-24        USD               EUR         0.818699
  </code></pre>