현재 데이터가 아래와 같이 1분 단위로 저장됩니다.
DEVICE_ADDRESS DATA_DT TEMPERATURE
DF:7F:78:CB:45:C2 2015-11-02 15:00:56 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:01:56 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:02:56 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:03:56 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:04:56 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:05:56 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:06:57 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:07:57 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:08:57 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:09:57 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:10:57 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:11:57 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:12:57 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:13:57 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:14:57 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:15:57 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:16:57 23
DF:7F:78:CB:45:C2 2015-11-02 15:17:57 23
DF:7F:78:CB:45:C2 2015-11-02 15:18:57 23
DF:7F:78:CB:45:C2 2015-11-02 15:19:57 23
DF:7F:78:CB:45:C2 2015-11-02 15:20:57 23.1
해당 값을 5분 단위로 평균을 내고 싶은데, 구간별로 나눠서
union으로 묶는거 외에는 방법이 없을까요..?
아래는 원하는 모습
DEVICE_ADDRESS DATA_DT avg(TEMPERATURE)
DF:7F:78:CB:45:C2 2015-11-02 15:00:56 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:05:56 23.7
DF:7F:78:CB:45:C2 2015-11-02 15:10:57 23.7
|