James Nunnerley wrote:
I'm trying to create a table, and ultimately a graph, out of some syslog
data.



I have a table with the following info in it:

Time (unixtime stamp), bytes rcvd and bytes sent



I want to create a sql statement that group the data over a certain period
of time, and produces the following table:

You don't tell us what this "certain period" is, in general you use date & time functions to manipulate time. If your period was one hour, you could use something like this:


select date_format(ts,"%Y-%m-%d %H") period,sum(rcvd),sum(sent)
  from mytable
  group by period;

<URL: http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html >

--
Roger


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to