问题
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