Postgresql – find number of orders required to purchase n products in sql
I've a sample dataset order_num order_date email product_id 101 2023-06-01 [email protected] 1 101 2023-06-01 [email protected] 2 222 2023-06-02 [email protected] 1 333 2023-06-03 [email protected] 3 434 2023-06-05 [email protected] 3 444 2023-06-01 [email protected] 1 444 2023-06-01 [email protected] 2 677 2023-06-02 [email protected] 3…