title: Can we use Sql BETWEEN operator with Hexa as Strings?
body: <p>If I use Sql BETWEEN operator with Hexa numbers as Strings, will i get the same result as converting the hexa in to numeric and then performing between operation.</p>
  <p><strong>Will the below two sql's get same results.</strong></p>
  <ol>
  <li><p>Product ID is stored in db as hexa string</p>
  <p>SELECT product_name FROM Products WHERE product_id BETWEEN &quot;24ab&quot; AND &quot;82df&quot; ORDER BY product_id;</p>
  </li>
  <li><p>Product ID is converted from hexa to decimal (int) in DB.</p>
  <p>SELECT product_name FROM Products WHERE product_id BETWEEN 9387 AND 33503 ORDER BY product_id;</p>
  </li>
  </ol>
  <p>My expectation is above two sql's will output same products.</p>
  <p><a href="https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_between_text2" rel="nofollow noreferrer">Example of sql BETWEEN operation on strings can be found here.</a></p>
  <pre><code>hexa(24ab) = decimal(9837)  and  
  hexa(82df) = decimal(33503)
  </code></pre>
  <p>Just curious - does string comparison use ascii value of each char to compare. I hope so.</p>