fix:iot首页统计中存在的TDengine中的SQL特异性问题:在TDengine中,GROUP BY子句不能直接使用别名。在你的SQL中,你先使用TIMETRUNCATE(ts, 1h) AS time定义了一个别名time,然后在GROUP BY time中使用了这个别名,这在TDengine中是不允许的。

This commit is contained in:
alwayssuper 2025-06-23 08:38:59 +08:00
parent a17d4bb281
commit b339801963

View File

@ -103,7 +103,7 @@
AND ts <= #{endTime} AND ts <= #{endTime}
</if> </if>
</where> </where>
GROUP BY time GROUP BY TIMETRUNCATE(ts, 1h)
</select> </select>
</mapper> </mapper>