Using the h2 database, I want to get the average values ββof a column when grouping records based on a timestamp.
My table looks like this:
TIME SID SERVICE TET 2012-11-21 11:31:45.433 164DSQL0L4JW7 service1 3868 2012-11-21 11:31:45.608 164DSS6TJS321 service2 350 2012-11-21 11:31:45.711 164DSROS9DNXA service2 285 2012-11-21 11:31:45.766 164DSH2PMPY4M service1 4044 2012-11-21 11:31:45.778 164DSOGRCKG8J service1 4248 2012-11-21 11:31:45.82 164DSRMV0QMFT service1 3766 2012-11-21 11:31:46.089 164DSP1L9W6MC service1 4257 2012-11-21 11:31:46.226 164DSOPUNUFJF service3 703 2012-11-21 11:31:46.752 164DSLJHST6E8 service3 411 2012-11-21 11:31:46.781 164DSHPI1T3J9 service3 393 2012-11-21 11:31:45.24 164DSQI4RY330 service2 235 2012-11-21 11:31:45.268 164DSPRDHROQN service2 197 2012-11-21 11:31:45.991 164DSRUUGQ8LN service2 380 2012-11-21 11:31:46.338 164DSMARDXMD3 service3 783
I would like to extract averages for a TET column grouped by a TET column. I want to have a flexible interval (for example, 15 seconds, and for another request - 5 minutes).
I found this question , which is pretty much what I need, but unfortunately I canβt get any of the solutions for working in H2 (there is no strftime there).
source share