title: SELECTING with multiple WHERE range conditions on same column
body: <p>I have tables like these:</p>
  
  <pre><code>  A table                            B table
  --------------------       -----------------------------------
  item_ID | item_Name         item_ID | option_ID | option_Value 
  --------------------       -----------------------------------
     1      item_a               2         34         2000
     2      item_b               2         45         3400
     3      item_c               2         12         1200  
     4      item_d               3         34         500
     5      item_e               3         13         500
     6      item_f               4         45         700
  </code></pre>
  
  <p>I wrote a query to get items, for example which have <strong>option 34 = 2000</strong> and <strong>option 12 = 1200</strong> is: </p>
  
  <pre><code>SELECT A.item_ID, A.item_name
  FROM A
  LEFT JOIN B ON A.item_ID = B.item_ID
  WHERE B.option_ID IN (34, 1200) AND
        B.option_Value IN (1200, 2000) AND
  GROUP BY A.item_ID
  HAVING COUNT(A.item_ID) &gt;= 2 /* count of option used for search, can be more*/
  </code></pre>
  
  <p>My problem is for some options I want to get range result , for example: where <strong>option id 34</strong> is between <strong>1000</strong> and <strong>2000</strong> and <strong>option 12</strong> is lower than <strong>4000</strong></p>
  
  <p><strong>Note</strong> : (option_id, option_value) pair is unique and i want to get items that match all of the conditions</p>