更新时间:2023-01-21 09:04:01
您可以使用子查询获取最大值,然后仅使用where
子句:
You can use a subquery to get the maximum and then just use a where
clause:
select t.*
from t cross join
(select max(revs) as maxrev from t) x
where t.revs >= x.maxrev - 100000;
我强烈建议您在revs
上建立索引.
I would strongly advise you to have an index on revs
.