You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
select caller_id as c_id, recipient_id as r_id, call_time from calls c1
union all
select recipient_id as c_id, caller_id as r_id, call_time from calls c2
),
temp2 as (
select *,
first_value(r_id) over(partition by c_id, date(call_time) order by date(call_time)) as f_v, last_value(r_id) over(partition by c_id, date(call_time) order by date(call_time)) as l_v from temp order by date(call_time)
)
select distinct c_id as 'user_id' from temp2 where f_v=l_v