- 2024-12-06leetcode-1193. 每月交易 I
建表语句:CreatetableIfNotExistsTransactions(idint,countryvarchar(4),stateenum('approved','declined'),amountint,trans_datedate)TruncatetableTransactionsinsertintoTransactions(id,country,state,amount,trans_date)
- 2024-10-12力扣数据库1193. 每月交易 I
一、数据表:Transactions+---------------+---------+|ColumnName|Type|+---------------+---------+|id|int||country|varchar||state|enum||amount|int||trans_date|date|+-------
- 2024-07-07聚合函数
1193.每月交易I-力扣(LeetCode)selectDATE_FORMAT(trans_date,'%Y-%m') ASmonth, country, count(1) astrans_count, COUNT(IF(state='approved',1,NULL))ASapproved_c