From 7404b76ec9caa1eb4823e4928b76f787417e61b3 Mon Sep 17 00:00:00 2001 From: Darci Date: Sun, 27 Oct 2024 23:12:09 -0400 Subject: [PATCH] adding SUM function --- sql/fashion_magazines.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/fashion_magazines.sql b/sql/fashion_magazines.sql index 0672d2b..60951aa 100644 --- a/sql/fashion_magazines.sql +++ b/sql/fashion_magazines.sql @@ -5,7 +5,7 @@ SELECT customers.customer_name AS Customer, --subscriptions.subscription_length*subscriptions.price_per_month AS "Amount Due" - '$' || printf('%.2f', subscriptions.subscription_length * subscriptions.price_per_month) AS "Amount Due" + '$' || printf('%.2f', SUM(subscriptions.subscription_length * subscriptions.price_per_month)) AS "Amount Due" FROM orders LEFT JOIN customers ON orders.customer_id = customers.customer_id LEFT JOIN subscriptions ON orders.subscription_id = subscriptions.subscription_id