Skip to content

Commit 161279b

Browse files
authored
Update 01127-user-purchase-platform.sql
1 parent fed90e1 commit 161279b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

01127-user-purchase-platform.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- we want all combinations of date and platform, hence create left table
22
-- right table- when number of rows for that date and user_id > 1, it means that user has used both platforms on that day, so keep platform = both, else platform
3-
-- sum of amount grouped by user_id and date
4-
-- final query- date and platform will be from left table, again SUM amount and count of users from right table
3+
-- sum of amount grouped by user_id and date- for that user and date
4+
-- final query- date and platform will be from left table, again SUM amount and count of users from right table- for that date specifically(all users are added up)
55
-- group amount and count users by user_id and date
66

77
with left_table as

0 commit comments

Comments
 (0)