给定伪表:
+-----+---------------------+------+
| tag | data | read |
+-----+---------------------+------+
| A | 2013-10-10 15:00:00 | 1345 |
+-----+---------------------+------+
| A | 2013-10-10 15:15:00 | 3454 |
+-----+---------------------+------+
| A | 2013-10-10 15:30:00 | 2345 |
+-----+---------------------+------+
| A | 2013-10-10 15:45:00 | 1132 |
+-----+---------------------+------+
| B | 2013-10-10 15:00:00 | 6234 |
+-----+---------------------+------+
| B | 2013-10-10 15:15:00 | 5432 |
+-----+---------------------+------+
| B | 2013-10-10 15:30:00 | 4563 |
+-----+---------------------+------+
| B | 2013-10-10 15:45:00 | 5432 |
+-----+---------------------+------+
是否可以仅使用 SQL 应用以下等式?
例子:
result=AVG(A)-(AVG(B)+AVG(C))
或者
result=AVG(A)+AVG(B)
按日期分组?