Just started learning sql query in Impala and I still cannot figure out how to get the desired results.
So I have a table:
And I would like to find out how to get the number of distinct product sold over time (from 1 Dec to 3 Dec 2020).
So the 1st day we sold 2 types of product (product_id 1 and 2), the second day we sold the same type of product comparing day before, therefore the cumulative remains as 2 and the last day we sold a product that was not sold two days before therefore the cumulative will be 3 types of products sold on the 3rd day
Thanks in advance!