|
@ -99,13 +99,15 @@ SELECT * FROM wlyy_quota_test where townName like '%湖里%'
|
|
|
**时间聚合使用**
|
|
|
|
|
|
```select town,townName,sum(result1) result1 from wlyy_quota_test group by town,townName,date_histogram(field='quotaDate','interval'='month')```
|
|
|
|
|
|
interval例子
|
|
|
```
|
|
|
1天 date_histogram(field='quotaDate','interval'='1d')
|
|
|
每周 date_histogram(field='quotaDate','interval'='week')
|
|
|
每月 date_histogram(field='quotaDate','interval'='month')
|
|
|
每季度 date_histogram(field='quotaDate','interval'='quarter')
|
|
|
每年 date_histogram(field='quotaDate','interval'='year')
|
|
|
|
|
|
```
|
|
|
|
|
|
**子字段(nested)查询**
|
|
|
|