我正在尝试以与此处spreadsheets.values.batchUpdate所述相同的方式使用 Google Sheets API函数。此示例使用 Google Apps 脚本。我想使用 Google Cloud Functions 来代替。
电子表格.values.batchUpdate API 文档可用。请注意,它与电子表格.batchUpdate不同,后者具有不同的语法。我有兴趣使用前者。
我想使用环境做同样的事情:Google Cloud Functions + nodejs8 + googleapismodule。
这是上面链接中的 Google Apps 脚本的示例代码:
function updateGoogleSheet(spreadsheetId) {
/* Written by Amit Agarwal */
/* Web: ctrlq.org Email: amit@labnol.org */
var data = [
{
range: "Sheet1!A1", // Update single cell
values: [
["A1"]
]
},
{
range: "Sheet1!B1:B3", // Update a column
values: [
["B1"],["B2"],["B3"]
]
},
{
range: "Sheet1!C1:E1", // Update a …Run Code Online (Sandbox Code Playgroud) google-sheets node.js google-apps-script google-cloud-functions
我有一张桌子,例如:
table a
+------+-------+
| v1 | v2 |
+------+-------+
| 1 | one |
| 2 | two |
| 3 | two |
| 4 | two |
| 5 | NULL |
| 6 | NULL |
| 7 | three |
| 8 | three |
+------+-------+
Run Code Online (Sandbox Code Playgroud)
我想按列“v2”对该表中的数据进行分组...
mysql> select * from a group by v2 order by v1;
+----+-------+
| v1 | v2 |
+----+-------+
| 1 | one |
| 2 | two | …Run Code Online (Sandbox Code Playgroud)