How to get new and returned YTD,MTD,WTD users in a user traffic table?

北城余情 提交于 2019-12-12 01:41:42

问题


I would like to get all the new and returned users from a user_traffic table. Just wondering what would be the approach in solving this problem. Any thoughts/inputs would be appreciated. I am not expecting a ready made solution for this problem but any kind of directional inputs would help me. Thank you.

user_traffic : Session_ID, session_day, glance_view_id, user_id, product_id.

Sample Input :-

create table user_traffic (session_id number(6), session_day date, 
                           user_id number(6), product_id number(6));

insert into user_traffic values (  1, date '2016-09-07', 101, 1);
insert into user_traffic values (  2, date '2016-09-07', 101, 4);
insert into user_traffic values (  3, date '2016-09-07', 102, 1);
insert into user_traffic values (  4, date '2016-09-08', 101, 2);
insert into user_traffic values (  5, date '2016-09-08', 101, 4);
insert into user_traffic values (  6, date '2016-09-09', 102, 1);
insert into user_traffic values (  7, date '2016-09-10', 102, 1);
insert into user_traffic values (  8, date '2016-09-10', 103, 3);

来源:https://stackoverflow.com/questions/39801594/how-to-get-new-and-returned-ytd-mtd-wtd-users-in-a-user-traffic-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!