i need to do a query but i can't find a good way to do it efficiently.
Everytime a client listen a song , one line is registered with his key and the track_id , date ....
I want to check for every clients if the track he listened the last month are new (never listened before this month so)
One line look like this:
key | track_id | date
asd | 12312 | 12/02/2020
fds | 12323 | 12/05/2020
etc
I think i can do something with window functions but i can't seem to find a good way to do it .
Then i also need to get the top 3 most listened song from this list, which i can just do with a window function i guess .
If someone can help me ? Thank you very much.
Use aggregation and window functions: