commit f5e2baf3479d6daa841f64b030cfdc43817d55b0 parent 0e488a3e48ea0200c15589b02bd21b4fe92b5a75 Author: AndrewLockVI <andrewlaack1@gmail.com> Date: Tue, 27 Jun 2023 07:27:20 -0500 Completed group sold products by the date using mySQL Diffstat:
| A | group-sold-products-by-the-date/group-sold-products-by-the-date.sql | | | 9 | +++++++++ |
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/group-sold-products-by-the-date/group-sold-products-by-the-date.sql b/group-sold-products-by-the-date/group-sold-products-by-the-date.sql @@ -0,0 +1,9 @@ +--Given a list of products return the number of +--unique products sold on given days and return +--a list of the distinct products as another +--column. + +SELECT sell_date, COUNT(DISTINCT product) as num_sold, GROUP_CONCAT(DISTINCT product) as products +FROM Activities +GROUP BY sell_date +