oracle语句
select ID
from (select ID,
time,
coun,
lag(coun, 1) over(partition by ID order by time) lag_coun1,
lag(coun, 2) over(partition by ID order by time) lag_coun2,
lag(coun, 3) over(partition by ID order by time) lag_coun3,
lag(coun, 4) over(partition by ID order by time) lag_coun4,
lag(coun, 5) over(partition by ID order by time) lag_coun5,
lag(coun, 6) over(partition by ID order by time) lag_coun6
from (select ID, trunc(add_time, day) time, count(*) coun
from table
where time > 10
and time < 24
group by ID, trunc(add_time)))
where coun > 30
and lag_coun1 > 30
and lag_coun2 > 30
and lag_coun3 > 30
and lag_coun4 > 30
and lag_coun5 > 30
and lag_coun6 > 30
谁能帮我转换成sql server语句
吃鸡游戏
慕的地8271018
相关分类