-----------------------------------------------------------
chan1 |chan2 |chan3 | captureTime |id
-----------------------------------------------------------
20 |21 |25 | 2011-10-11 00:00:00 |1
-----------------------------------------------------------
21 |18 |19 | 2011-10-11 00:01:00 |1
-----------------------------------------------------------
....
....
....
-----------------------------------------------------------
20 |25 |21 | 2011-10-11 00:15:00 |1
-----------------------------------------------------------
21 |18 |14 | 2011-10-11 00:16:00 |1
....
....
....
-----------------------------------------------------------
15 |26 |23 | 2011-10-11 23:58:00 |1
-----------------------------------------------------------
17 |14 |32 | 2011-10-11 23:59:00 |1
The table store chan1,chan2 and chan3 value every one minute. I want to get the maximum & minimum values for every 10 minutes and also have the corresponding the captureTime for min/max values.
Based on those requirments, How to write the sql query? Thanks!