mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-08 00:41:42 +08:00
批量更新数据
This commit is contained in:
@@ -12,12 +12,12 @@
|
||||
"translatedContent": "<p>配送表: <code>Delivery</code></p>\n\n<pre>\n+-----------------------------+---------+\n| Column Name | Type |\n+-----------------------------+---------+\n| delivery_id | int |\n| customer_id | int |\n| order_date | date |\n| customer_pref_delivery_date | date |\n+-----------------------------+---------+\ndelivery_id 是该表中具有唯一值的列。\n该表保存着顾客的食物配送信息,顾客在某个日期下了订单,并指定了一个期望的配送日期(和下单日期相同或者在那之后)。\n</pre>\n\n<p> </p>\n\n<p>如果顾客期望的配送日期和下单日期相同,则该订单称为 「<strong>即时订单</strong>」,否则称为「<strong>计划订单</strong>」。</p>\n\n<p>「<strong>首次订单</strong>」是顾客最早创建的订单。我们保证一个顾客只会有一个「首次订单」。</p>\n\n<p>编写解决方案以获取即时订单在所有用户的首次订单中的比例。<strong>保留两位小数。</strong></p>\n\n<p>结果示例如下所示:</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>\nDelivery 表:\n+-------------+-------------+------------+-----------------------------+\n| delivery_id | customer_id | order_date | customer_pref_delivery_date |\n+-------------+-------------+------------+-----------------------------+\n| 1 | 1 | 2019-08-01 | 2019-08-02 |\n| 2 | 2 | 2019-08-02 | 2019-08-02 |\n| 3 | 1 | 2019-08-11 | 2019-08-12 |\n| 4 | 3 | 2019-08-24 | 2019-08-24 |\n| 5 | 3 | 2019-08-21 | 2019-08-22 |\n| 6 | 2 | 2019-08-11 | 2019-08-13 |\n| 7 | 4 | 2019-08-09 | 2019-08-09 |\n+-------------+-------------+------------+-----------------------------+\n<strong>输出:</strong>\n+----------------------+\n| immediate_percentage |\n+----------------------+\n| 50.00 |\n+----------------------+\n<strong>解释:</strong>\n1 号顾客的 1 号订单是首次订单,并且是计划订单。\n2 号顾客的 2 号订单是首次订单,并且是即时订单。\n3 号顾客的 5 号订单是首次订单,并且是计划订单。\n4 号顾客的 7 号订单是首次订单,并且是即时订单。\n因此,一半顾客的首次订单是即时的。\n</pre>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 77,
|
||||
"likes": 126,
|
||||
"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\": \"22K\", \"totalSubmission\": \"39.6K\", \"totalAcceptedRaw\": 21991, \"totalSubmissionRaw\": 39586, \"acRate\": \"55.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"50.9K\", \"totalSubmission\": \"95K\", \"totalAcceptedRaw\": 50882, \"totalSubmissionRaw\": 95029, \"acRate\": \"53.5%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -79,7 +79,7 @@
|
||||
"insert into Delivery (delivery_id, customer_id, order_date, customer_pref_delivery_date) values ('7', '4', '2019-08-09', '2019-08-09')"
|
||||
],
|
||||
"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,
|
||||
|
Reference in New Issue
Block a user