I have two tables the event table which holds the data and a table which has an entry for each minute

CREATE TABLE event_data (
 call_id INTEGER PRIMARY KEY,
 desc varchar(32) NOT NULL default '',
 event_time datetime default NULL,
 stamptime integer default NULL,
 duration integer default NULL
);
'stamptime' is the unix time (Number of seconds
since 1970) representation of 'event_time'
'duration' is the duration of the event in seconds

CREATE TABLE integers60 (
 i INTEGER
);

So I was hoping to us the query the integers table and use the results 'i' as a datatime modifier in the event_data table. Not much luck though.

----- Original Message ----- From: "D. Richard Hipp" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Wednesday, February 23, 2005 12:26 PM
Subject: Re: [sqlite] tricky date time problem



On Mon, 2005-02-21 at 21:49 +0000, Lloyd Thomas wrote:
I have a query which calculates the number of events during an hour by the
minute. It needs to work out which minute has the most events and the
average events during that hour. So it should return an array of 60 results
for an hour where I can use the MAX() feature in php to find the peak
minute.



How are you storing time values? Julian day number/ Number of seconds since 1970? IS09601? And what is the schema for the table you are querying? -- D. Richard Hipp <[EMAIL PROTECTED]>




Reply via email to