开窗函数并连接表的灵活运用

开窗函数并连接表的灵活运用_第1张图片
Select
a.m_id,a.path_dql,b.page_url from_url,a.page_url to_url
From (
Select
M_id,
Page_url,
Visit_time,
Row_number() over(partition by m_id order by visit_time as ) as path_seq
From app_page_view ) a
Left outer join
(
Select
M_id,
Page_url,
Visit_time,
Row_number() over(partition by m_id order by visit_time as ) as path_seq
From app_page_view ) b on a.path_seq = b.path_deq + 1 and a.m_id = b.m_id

你可能感兴趣的:(mysql)