By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
version() |
---|
8.0.27 |
customer_id | product | order_date_id | first_product | first_occurrance |
---|---|---|---|---|
C0001 | apple | 20200224 | null | 1 |
C0001 | apple | 20200226 | null | 2 |
C0001 | pear | 20220101 | null | 3 |
C0002 | strawberry | 20200224 | null | 1 |
customer_id | min_order_date |
---|---|
C0001 | 20200224 |
C0002 | 20200224 |
customer_id | product | order_date_id | first_product |
---|---|---|---|
C0001 | apple | 20200224 | apple |
C0001 | pear | 20220101 | apple |
C0002 | strawberry | 20200224 | strawberry |
C0001 | apple | 20200226 | apple |