I need to create an inline view that will give me all dates between two
specified. Here is the question posed to me that I need to answer:
This basic query gets me the last 6 hours of history table entries for
an item, grouped into minutes (if an item has a delay of 5 seconds, it
takes the max
Bryan
A subqueryless (ie join) version of your query will likely be faster:
select
from_unixtime(t.clock),
DATE_FORMAT(from_unixtime(t.clock),'%j %h:%i %p') as mins,
MAX(t.value) as value_max
from history t
join items i using (itemid)
where t.itemid = @iid
and i.hostid = @hid
and