1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-07 00:11: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,12 +12,12 @@
"translatedContent": "<p>表:<code>DailySales</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| date_id | date |\n| make_name | varchar |\n| lead_id | int |\n| partner_id | int |\n+-------------+---------+\n该表没有主键(具有唯一值的列)。它可能包含重复项。\n该表包含日期、产品的名称以及售给的领导和合伙人的编号。\n名称只包含小写英文字母。</pre>\n\n<p>&nbsp;</p>\n\n<p>对于每一个&nbsp;<code>date_id</code>&nbsp;和&nbsp;<code>make_name</code>,找出&nbsp;<strong>不同&nbsp;</strong>的&nbsp;<code>lead_id</code>&nbsp;以及&nbsp;<strong>不同&nbsp;</strong>的&nbsp;<code>partner_id</code>&nbsp;的数量。</p>\n\n<p>按 <strong>任意顺序</strong> 返回结果表。</p>\n\n<p>返回结果格式如下示例所示。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>\nDailySales 表:\n+-----------+-----------+---------+------------+\n| date_id | make_name | lead_id | partner_id |\n+-----------+-----------+---------+------------+\n| 2020-12-8 | toyota | 0 | 1 |\n| 2020-12-8 | toyota | 1 | 0 |\n| 2020-12-8 | toyota | 1 | 2 |\n| 2020-12-7 | toyota | 0 | 2 |\n| 2020-12-7 | toyota | 0 | 1 |\n| 2020-12-8 | honda | 1 | 2 |\n| 2020-12-8 | honda | 2 | 1 |\n| 2020-12-7 | honda | 0 | 1 |\n| 2020-12-7 | honda | 1 | 2 |\n| 2020-12-7 | honda | 2 | 1 |\n+-----------+-----------+---------+------------+\n<strong>输出:</strong>\n+-----------+-----------+--------------+-----------------+\n| date_id | make_name | unique_leads | unique_partners |\n+-----------+-----------+--------------+-----------------+\n| 2020-12-8 | toyota | 2 | 3 |\n| 2020-12-7 | toyota | 1 | 2 |\n| 2020-12-8 | honda | 2 | 2 |\n| 2020-12-7 | honda | 3 | 2 |\n+-----------+-----------+--------------+-----------------+\n<strong>解释:</strong>\n在 2020-12-8丰田toyota有领导者 = [0, 1] 和合伙人 = [0, 1, 2] 同时本田honda有领导者 = [1, 2] 和合伙人 = [1, 2]。\n在 2020-12-7丰田toyota有领导者 = [0] 和合伙人 = [1, 2] 同时本田honda有领导者 = [0, 1, 2] 和合伙人 = [1, 2]。</pre>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 53,
"likes": 64,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
"contributors": [],
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"typescript\": false, \"bash\": false, \"php\": false, \"swift\": false, \"kotlin\": false, \"dart\": false, \"golang\": false, \"ruby\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"rust\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"pythondata\": false, \"react\": false, \"vanillajs\": false, \"postgresql\": false}",
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"typescript\": false, \"bash\": false, \"php\": false, \"swift\": false, \"kotlin\": false, \"dart\": false, \"golang\": false, \"ruby\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"rust\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"pythondata\": false, \"react\": false, \"vanillajs\": false, \"postgresql\": false, \"cangjie\": false}",
"topicTags": [
{
"name": "Database",
@@ -59,7 +59,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"35K\", \"totalSubmission\": \"42.7K\", \"totalAcceptedRaw\": 35028, \"totalSubmissionRaw\": 42651, \"acRate\": \"82.1%\"}",
"stats": "{\"totalAccepted\": \"44.6K\", \"totalSubmission\": \"53.6K\", \"totalAcceptedRaw\": 44590, \"totalSubmissionRaw\": 53645, \"acRate\": \"83.1%\"}",
"hints": [],
"solution": null,
"status": null,
@@ -82,7 +82,7 @@
"insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-7', 'honda', '2', '1')"
],
"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,