我有兩個排序集合,並且想要交集,即。 (age BETWEEN 25, 35) AND (salary BETWEEN 250, 350)
兩個或多個排序集合的交集
有關於效率比一個更好的辦法:
ZUNIONSTORE t_age 1 age WEIGHTS 1
ZREMRANGEBYSCORE t_age -inf (25
ZREMRANGEBYSCORE t_age (35 +inf
ZINTERSTORE result 2 salary t_age WEIGHTS 1 0
ZRANGEBYSCORE result 250 350
你的意思是'ZINTERSTORE結果2薪水t_age重量1 0 '與零? – thepirat000
存儲結果的假設命令ZRANGEBYSCORESTORE將有助於彙總數據。還有ZREMRANGEBYSCORE的獨家版本... – thepirat000
查看[this](https://groups.google.com/forum/#!searchin/redis-db/ZRANGEBYSCORE/redis-db/8TBbISxd244/Rtl5VNdQWAMJ) – thepirat000