title: Get consecutive numbers Range from SQL Server Table
body: <p>I am using <code>SQL Server 2014</code>. I have a Table having Column <code>BookNo</code> as <code>datatype int</code>. This column contains below data</p>
  
  <pre><code>|BookNo|
  1
  2
  3
  4
  5
  10
  12
  13
  25
  26
  27
  28
  </code></pre>
  
  <p>I want to the Consecutive Numbers Range in Sql query. From above data my output should be like </p>
  
  <pre><code>1 to 5
  10 to 13
  25 to 28
  </code></pre>
  
  <p>Any Help...</p>