SELECT a.* FROM table1 a WHERE a.tm > '2021-11-12 17:00:00' and (SELECT count(*) FROM table1 WHERE tm > '2021-11-12 17:00:00' and re_id=a.re_id AND tm>a.tm) < 2 order by a.re_id,a.tm DESC
注意:本文归作者所有,未经作者允许,不得转载
SELECT a.* FROM table1 a WHERE a.tm > '2021-11-12 17:00:00' and (SELECT count(*) FROM table1 WHERE tm > '2021-11-12 17:00:00' and re_id=a.re_id AND tm>a.tm) < 2 order by a.re_id,a.tm DESC
注意:本文归作者所有,未经作者允许,不得转载