1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-06 16:01:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

批量更新数据

This commit is contained in:
2025-01-09 20:29:41 +08:00
parent 04ecea043d
commit 48cdd06c2b
5053 changed files with 156164 additions and 135322 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>表:<code>transactions</code></p>\n\n<pre>\n+------------------+------+\n| Column Name | Type | \n+------------------+------+\n| transaction_id | int |\n| amount | int |\n| transaction_date | date |\n+------------------+------+\ntransactions_id 列唯一标识了表中的每一行。\n这张表的每一行包含交易 id金额总和和交易日期。\n</pre>\n\n<p>编写一个解决方案来查找每天 <strong>奇数</strong> 交易金额和 <strong>偶数</strong> 交易金额的 <strong>总和</strong>。如果某天没有奇数或偶数交易,显示为&nbsp;<code>0</code>。</p>\n\n<p>返回结果表以&nbsp;<code>transaction_date</code> <strong>升序</strong>&nbsp;排序。</p>\n\n<p>结果格式如下所示。</p>\n\n<p>&nbsp;</p>\n\n<p><strong class=\"example\">示例:</strong></p>\n\n<div class=\"example-block\">\n<p><b>输入:</b></p>\n\n<p><code>transactions</code> 表:</p>\n\n<pre class=\"example-io\">\n+----------------+--------+------------------+\n| transaction_id | amount | transaction_date |\n+----------------+--------+------------------+\n| 1 | 150 | 2024-07-01 |\n| 2 | 200 | 2024-07-01 |\n| 3 | 75 | 2024-07-01 |\n| 4 | 300 | 2024-07-02 |\n| 5 | 50 | 2024-07-02 |\n| 6 | 120 | 2024-07-03 |\n+----------------+--------+------------------+\n </pre>\n\n<p><strong>输出:</strong></p>\n\n<pre class=\"example-io\">\n+------------------+---------+----------+\n| transaction_date | odd_sum | even_sum |\n+------------------+---------+----------+\n| 2024-07-01 | 75 | 350 |\n| 2024-07-02 | 0 | 350 |\n| 2024-07-03 | 0 | 120 |\n+------------------+---------+----------+\n </pre>\n\n<p><strong>解释:</strong></p>\n\n<ul>\n\t<li>对于交易日期:\n\t<ul>\n\t\t<li>2024-07-01:\n\t\t<ul>\n\t\t\t<li>奇数交易金额总和75</li>\n\t\t\t<li>偶数交易金额总和150 + 200 = 350</li>\n\t\t</ul>\n\t\t</li>\n\t\t<li>2024-07-02:\n\t\t<ul>\n\t\t\t<li>奇数交易金额总和0</li>\n\t\t\t<li>偶数交易金额总和300 + 50 = 350</li>\n\t\t</ul>\n\t\t</li>\n\t\t<li>2024-07-03:\n\t\t<ul>\n\t\t\t<li>奇数交易金额总和0</li>\n\t\t\t<li>偶数交易金额总和120</li>\n\t\t</ul>\n\t\t</li>\n\t</ul>\n\t</li>\n</ul>\n\n<p><b>注意:</b>输出表以&nbsp;<code>transaction_date</code>&nbsp;升序排序。</p>\n</div>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 0,
"likes": 1,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -59,7 +59,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"408\", \"totalSubmission\": \"548\", \"totalAcceptedRaw\": 408, \"totalSubmissionRaw\": 548, \"acRate\": \"74.5%\"}",
"stats": "{\"totalAccepted\": \"2.4K\", \"totalSubmission\": \"3.5K\", \"totalAcceptedRaw\": 2401, \"totalSubmissionRaw\": 3495, \"acRate\": \"68.7%\"}",
"hints": [],
"solution": null,
"status": null,
@@ -78,7 +78,7 @@
"insert into transactions (transaction_id, amount, transaction_date) values ('6', '120', '2024-07-03')"
],
"enableRunCode": true,
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"],\"pythondata\":[\"Pandas\",\"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\"<p>PostgreSQL 16<\\/p>\"]}",
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"],\"pythondata\":[\"Pandas\",\"<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\"<p>PostgreSQL 16<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,