Loved to see how the window function simplified the query here! Thank you for helping us understand this better.
@frederikmuller2 жыл бұрын
Thanks for leaving so many comments!
@whiterabbit94282 жыл бұрын
Thanks for your excellent explanation!
@nukagvilia41412 жыл бұрын
Thanks for a great video! Could you explain which solution would be better in terms of time complexity? Which is faster, window functions or self joins?
@HenggaoCai3 жыл бұрын
Well said!
@rishianand48923 жыл бұрын
select player_id,event_date, (select sum(games_played) from activity a2 where a2.player_id=a1.player_id and a2.event_date
@parveshkiran72173 жыл бұрын
while giving explanation just try to give in a manner that its easy to understand..ur explanation is good but ur way of explanation is like speaking to urself
@frederikmuller3 жыл бұрын
thanks for the constructive feedback, I'll try incorporating that into my future videos!
@rahulpoptani902 жыл бұрын
@@frederikmuller You are doing great! No need to change anything!
@johnhhu21373 жыл бұрын
So the code actually works like python code, running row by row
@rishianand48923 жыл бұрын
Will below query work: select player_id,MAX(event_date) AS event_date,sum(games_played) as games_played_so_far from activity a1 where (player_id,event_date) in (select player_id,event_date from activity a2 where a2.player_id=a1.player_id and a2.event_date
@ruthraramanan34073 жыл бұрын
*alarm went off*🤣🤣🤣
@ujjwalshrivastava35942 жыл бұрын
if u can put table schema it will really be good
@johnhhu21373 жыл бұрын
Here is my code on Datagrip, just not understand very well on: SUM(b.games_played) a.event_data=b.event_date GROUP BY a.player_id,a.device_id,a.event_date;
@ruthraramanan34073 жыл бұрын
it's just the main table(in ur case b) date should be less than the iterating table(a). that's why a.event_date>=b.event_date. Else the way Fred did is vice versa. Hope u understand.