Hi All,
I'd like to know where the latest data stored...
I'm using mysql database
can anyone help me
thanks in advance
I'd like to know where the latest data stored...
I'm using mysql database
can anyone help me
thanks in advance
select i.itemid,
from_unixtime(clock),
t.num,
t.value_min,
t.value_avg,
t.value_max
from hosts h,
items i,
trends t
where i.hostid=h.hostid
and t.itemid=i.itemid
and h.host='my_host'
and i.description='my_item'
order by clock desc
+--------+----------------------+-----+-----------+-----------+-----------+ | itemid | from_unixtime(clock) | num | value_min | value_avg | value_max | +--------+----------------------+-----+-----------+-----------+-----------+ | 19571 | 2010-03-31 10:00:00 | 12 | 0.6400 | 1.6033 | 3.2400 | | 19571 | 2010-03-31 09:00:00 | 12 | 0.3700 | 1.0092 | 2.0200 |

select i.itemid,
from_unixtime(clock),
t.num,
t.value_min,
t.value_avg,
t.value_max
from hosts h,
items i,
trends t
where i.hostid=h.hostid
and t.itemid=i.itemid
and h.host='my_host'
and i.description='my_item'
order by clock desc
+--------+----------------------+-----+-----------+-----------+-----------+ | itemid | from_unixtime(clock) | num | value_min | value_avg | value_max | +--------+----------------------+-----+-----------+-----------+-----------+ | 19571 | 2010-03-31 10:00:00 | 12 | 0.6400 | 1.6033 | 3.2400 | | 19571 | 2010-03-31 09:00:00 | 12 | 0.3700 | 1.0092 | 2.0200 |

Comment