title: SQL Server: order of returned rows when using IN clause
body: <p>Running the following query returns 4 rows. As I can see in SSMS the order of returned rows is the same as I specified in the IN clause.</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT * FROM Table WHERE ID IN (4,3,2,1)
  </code></pre>
  
  <p>Can I say that the order of returned rows are ALWAYS the same as they appear in the IN clause?</p>
  
  <p>If yes then is it true, that the following two queries return the rows in the same order? (as I've tested the orders are the same, but I don't know if I can trust this behavior)</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT TOP 10 * FROM Table ORDER BY LastModification DESC
  
  SELECT * FROM Table WHERE ID IN (SELECT TOP 10 ID FROM Table ORDER BY LastModification DESC)
  </code></pre>
  
  <p>I ask this question because I have a quite complex select query. Using this trick over it brings me ca. 30% performance gain, in my case.</p>