對多筆資料執行 Google Visualization API Query Language 查詢作業。
使用範本
QUERY(A2:E6,"select avg(A) pivot B")
QUERY(A2:E6,F2,FALSE)
語法
QUERY(資料, 查詢, [標題])
-
資料
- 查詢作業針對的儲存格範圍。-
Each column of
data
can only hold boolean, numeric (including date/time types) or string values. -
In case of mixed data types in a single column, the majority data type determines the data type of the column for query purposes. Minority data types are considered null values.
-
-
查詢
- The query to perform, written in the Google Visualization API Query Language.-
查詢
的值須輸入在引號內,或為包含適當文字的儲存格參照。 -
如要進一步瞭解查詢語言,請前往 https://developers.google.com/chart/interactive/docs/querylanguage。
-
-
標題
- [ OPTIONAL ] - The number of header rows at the top ofdata
。如果忽略這個引數或設成-1
,則系統會根據資料
內容猜測引數值。
範例
範例資料。
Returns rows that match the speified condition using 選取
和Where
clauses.
Aggregates Salary
values across rows using 選取
和Group by
clauses.
Transforms distinct valus in columns into new columns..
Aggregates Dept
values accross rows and sorts by the maximum value of Salary
。
Specifies the number of header rows in the input range, which enables transformation of multi-header rows range input to be transofrmed to a single row header input.