 min,' .                     'MAX(value) AS max,MAX(clock) AS clock' .                     ' FROM history_uint ' .                     ' WHERE itemid=' . $itemInfo['itemid'] .                     ' AND clock>=' . $from_time .                     ' AND clock<=' . $to_time .                     ' GROUP BY itemid,' . $calc_field             );         