select distinct device_id from (select device_id, cnt, lead(cnt, 1, 0) over(partition by device_id order by month_now) as cnt_next, month_now, lead(month_now,1,month_now) over(partition by device_id o...