redis 如何实现数据按 id 或者 timestamp 筛选?
比如,像 sql 这样
sql
select * from news_table where id > '512'; select * from news_table where id > '512' and cat_id = '2'; select * from news_table where pubdate > 'yesterday';
sql
-- news_table info CREATE TABLE `news_table` ( `id` int(10), `cat_id`, int(10), `title` text, `content` longtext, `pubdate` int(10), );
请题主看看redis的zset,scop可以实现你的要求,但是你说的id大于的那种查询最好在redis换换思路,这不是它的长项