I have installs table with installs that have the same user_id but different install_date.
I want to get all revenue records joined with nearest install record by install_date that is less then revenue_date because I need it's source field value for next processing.
That means that output rows count should be equal to revenue table records.
How can it be achieved in BigQuery?
Here is the data:
installs
install_date user_id source
--------------------------------
2020-01-10 user_a source_I
2020-01-15 user_a source_II
2020-01-20 user_a source_III
***info about another users***
revenue
revenue_date user_id revenue
--------------------------------------------
2020-01-11 user_a 10
2020-01-21 user_a 20
***info about another users***
