title: Best way to get right n digits from number in SQL Server (CE)
body: <p>I have a sql server compact framework database and I want to query an int column</p>
  
  <p>the column can contain values from 1 to 99999999 and I am interested in the right 4 digits</p>
  
  <p>Examples:</p>
  
  <pre><code>     1 -&gt;    1
      12 -&gt;   12
     123 -&gt;  123
    1234 -&gt; 1234
   12345 -&gt; 2345
  123456 -&gt; 3456
  </code></pre>
  
  <p>I could convert the result to string and use substring, but there is propably a better solution.</p>