title: Redis get member where score is between min and max
body: <p>I have a table in sql with 3 columns: <code>BIGINT StartNumber, BIGINT EndNumber, BIGINT LocationId</code>, and I need to be able to do something like this </p>
  
  <pre><code>Select LocationId where StartNumber &lt; @number and EndNumber &gt; @number.
  </code></pre>
  
  <p>for example: </p>
  
  <pre><code>StartNumber EndNumber LocationId
  1             5          1
  6             9          1
  10            16         2
  </code></pre>
  
  <p>and when I have @number = 7 I should get LocationId = 1</p>
  
  <p>How can I do this in redis?</p>
  
  <p>I was thinking to move this table to redis, use sorted set and <code>ZRANGEBYSCORE</code> but it did't work for me:
  1) When I am using ZADD key score member [score] [member], I am unable to add 2 elements with the same member and different score even with nx parameter:
  <code>zadd myset nx 1 "17" 2 "17"</code> - it will add one element and then update its score instead of adding two elements.
  2) when I am adding this: <code>zadd set1 2 "a" 4 "b" 6 "c" 10 "d"</code> and then trying to do zrangebyscore set1 3 3 (want to get member whose score include 3) I em getting empty result</p>
  
  <p>P.s. All commands are executed on the example pages of redis website.</p>