Skip to content

Commit

Permalink
Time: 682 ms (100.00%), Space: 0B (100.00%) - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
joseantoniochacon committed Jun 4, 2024
1 parent 5657950 commit 4669b55
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 1193-monthly-transactions-i/1193-monthly-transactions-i.sql
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 4669b55

Please sign in to comment.