-
having
String
與 outStatistics 和 groupByFieldsForStatistics 一起使用的條件,用於將查詢結果限製為滿足聚合函數的組。
此子句支持以下聚合函數:
MIN
|MAX
|AVG
|SUM
|STDDEV
|COUNT
|VAR
having
中使用的聚合函數也必須包含在outStatistics
中。有關其工作原理的示例,請參見下麵的代碼段。對於基於服務的圖層查詢,僅當圖層的 supportsHavingClause 屬性為
true
時,此參數才適用。所有LayerView 查詢都支持此屬性。例子:
query.outStatistics = [{ onStatisticField: "CUSTOMERS", outStatisticFieldName: "avg_customers", statisticType: "avg" }, { onStatisticField: "RATING", outStatisticFieldName: "min_rating", statisticType: "min" }, { onStatisticField: "1=1", outStatisticFieldName: "total_businesses", statisticType: "count" }]; query.groupByFieldsForStatistics = [ "region" ]; query.having = "AVG(CUSTOMERS) >= 1,000 AND MIN(RATING) >= 3"; // query the above stats for all regions where // the average number of daily customers per business is // greater than 1,000 and the minimum customer rating // for a business within the region is 3 layer.queryFeatures(query).then(displayResults);
基本信息
以下是所在類或對象的基本信息。
AMD:
require(["esri/rest/support/Query"], (Query) => { /* code goes here */ });
ESM:
import Query from "@arcgis/core/rest/support/Query";
類:
esri/rest/support/Query
繼承: Query > Accessor
自從:用於 JavaScript 4.20 的 ArcGIS API
用法說明
Query.having
函數(或屬性)的定義如下:
相關用法
- JavaScript ArcGIS Query.aggregateIds用法及代碼示例
- JavaScript ArcGIS Query.where用法及代碼示例
- JavaScript ArcGIS Query.quantizationParameters用法及代碼示例
- JavaScript ArcGIS Query.units用法及代碼示例
- JavaScript ArcGIS Query.relationParameter用法及代碼示例
- JavaScript ArcGIS Query.outStatistics用法及代碼示例
- JavaScript ArcGIS Query.multipatchOption用法及代碼示例
- JavaScript ArcGIS Query.groupByFieldsForStatistics用法及代碼示例
- JavaScript ArcGIS Query.timeExtent用法及代碼示例
- JavaScript ArcGIS Query.spatialRelationship用法及代碼示例
- JavaScript ArcGIS Query.orderByFields用法及代碼示例
- JavaScript ArcGIS Query.outFields用法及代碼示例
- JavaScript ArcGIS QueryTask.executeRelationshipQuery用法及代碼示例
- JavaScript ArcGIS Query用法及代碼示例
- JavaScript ArcGIS QueryTask.executeForCount用法及代碼示例
- JavaScript ArcGIS QueryTask用法及代碼示例
- JavaScript ArcGIS QueryTask.execute用法及代碼示例
- JavaScript ArcGIS QueryTask.executeForIds用法及代碼示例
- JavaScript QUnit.test.each()用法及代碼示例
- JavaScript QUnit.test.only()用法及代碼示例
- JavaScript QUnit.config.filter用法及代碼示例
- JavaScript QUnit.extend()用法及代碼示例
- JavaScript QUnit.config.current用法及代碼示例
- JavaScript QUnit.config.urlConfig用法及代碼示例
- JavaScript QUnit.begin()用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 Query.having。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。