中国开发网: 论坛: 程序员情感CBD: 贴子 802107
好望角
给个例子吧,我鼓捣了两个SQL,结果有差距啊
select * from other_table where
mod(
(select count(*) from (
select (_time - 60 * 1000) gate from one_table where event = 123
union all
select (_time + 60 * 1000) gate from one_table where event = 123
)
where _time > gate
), 2) = 1;


select * from other_table
from other_table t1, (select (_time - 60 * 1000) b, (_time + 60 * 1000) e from one_table where event = 123) t2
where t1._time between tt.t1 and tt.t2;

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录