diff --git a/1193-monthly-transactions-i/1193-monthly-transactions-i.sql b/1193-monthly-transactions-i/1193-monthly-transactions-i.sql new file mode 100644 index 0000000..2f35b0c --- /dev/null +++ b/1193-monthly-transactions-i/1193-monthly-transactions-i.sql @@ -0,0 +1,2 @@ +# Write your MySQL query statement below +SELECT DATE_FORMAT(trans_date,'%Y-%m') AS month, country, COUNT(id) AS trans_count, SUM(IF(state='approved',1,0)) AS approved_count, SUM(amount) AS trans_total_amount, SUM(IF(state='approved',amount,0)) AS approved_total_amount FROM Transactions GROUP BY month, country; \ No newline at end of file