title: How to perform range queries across tables in SQL
body: <p>I have two tables in a MySQL database. In the first column of data in table A (A1) I have integer values. In the first and second columns of table B (B1 and B2) I also have integer values. I would like to create a query which would give me the values where A1 is within the range B1 - B2. Is this possible to do with a MySQL query?</p>
  
  <p>Here is an example of what I would like to know how to do:</p>
  
  <pre><code>Table A        Table B    
  -------        -------    --------
  123            12         24
  451            450        455
  199            202        210
  0              499        567
  23             5          40
  </code></pre>
  
  <p>The SQL query I am looking for would return the matching A1, B1, and B2 values:</p>
  
  <pre><code>451    450     455
  23     12      24
  23     5       40
  </code></pre>