Dennis, syntax error somewhere.
'group by minute union select 0, 0 where not exists (select * from
event_data)'
Lloyd
- Original Message -
From: "Dennis Cote" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Thursday, February 24, 2005 1:31 AM
Subject: Re
Lloyd,
A small improvement is to limit the number of rows used to test for event existence. This avoid scanning the whole event_data table if there are many events.
select minutes.i as minute, count(*) as events
from
(select (event_time / 60) % 60 as begin_minute,
((event_time +
-
From: "Dennis Cote" <[EMAIL PROTECTED]>
To: "sqlite-users" <sqlite-users@sqlite.org>
Sent: Wednesday, February 23, 2005 8:51 PM
Subject: Re: [sqlite] tricky date time problem
Dennis Cote wrote:
I though you wanted the minute with the most events. I
Dennis Cote wrote:
I though you wanted the minute with the most events. I added the outer
select to show that that step can be done easily in the same query,
rather than relying on PHP to extract this info from the full results
for the hour.
But of course that portion of the query doesn't work
Lloyd Thomas wrote:
Revisted your query. I was being a bit lazy. changed 'select minute,
max(events)' to 'select minute, events' and added 'order by minute'
to give me what I needed.
Thanks
Lloyd,
If you want the whole table simply remove the outer select and add the
order by clause as below.
-users" <sqlite-users@sqlite.org>
Sent: Wednesday, February 23, 2005 5:41 PM
Subject: Re: [sqlite] tricky date time problem
Lloyd,
I messed up the math for the end minute calculation. :-[
The correct query is given below. Adding 59 was intended to round the
result of an integer division (whi
indicate where I am going wrong.
Lloud
- Original Message -
From: "Jay" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>; <[EMAIL PROTECTED]>
Sent: Wednesday, February 23, 2005 5:39 PM
Subject: Re: [sqlite] tricky date time problem
--- Lloyd Thomas <[EMAI
Lloyd,
I messed up the math for the end minute calculation. :-[
The correct query is given below. Adding 59 was intended to round the
result of an integer division (which drops the remainder), but I'm
actually keeping the reminader and throwing away the quotient so it was
simply wrong.
--- Lloyd Thomas <[EMAIL PROTECTED]> wrote:
> Thanks Jay/DRH,
> this looks more promising (The "%"
> operator
> gives you remainder after division). Still not sure how I could apply
> it to
> start and end unix times.
> The columns I have are :-
> hour start = start
lt;sqlite-users@sqlite.org>
n.plus.com> cc:
Subject: Re: [sqlite] tricky
date time problem
02/22/2005 06:41 PM
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 +, Lloyd Thomas
On Mon, 2005-02-21 at 21:49 +, 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
ion <= 1081335540
The result I get is
0|15
I was expecting 60 result rows
any Ideas? Is this a version 3 operator only?
- Original Message -
From: "Lloyd Thomas" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Tuesday, February 22, 2005 11:41 PM
Subject: Re: [sqli
ite-users@sqlite.org>
Sent: Tuesday, February 22, 2005 2:47 PM
Subject: Re: [sqlite] tricky date time problem
--- "D. Richard Hipp" <[EMAIL PROTECTED]> wrote:
> It's too bad Sqlite doesn't have the modulo operator,
The "%" operator gives you remainder after division,
whic
--- "D. Richard Hipp" <[EMAIL PROTECTED]> wrote:
> > It's too bad Sqlite doesn't have the modulo operator,
>
> The "%" operator gives you remainder after division,
> which is very close to being a modulo operator.
Thanks! I went looking for the page in the documentation about
expressions to
that.
> |
> ---
> How would you do that in C?
>
> - Original Message -
> From: "Jay" <[EMAIL PROTECTED]>
> To: <sqlite-users@sqlite.org>; <[EMAIL PROTECTED]>
> Sent:
try that.
|
---
How would you do that in C?
- Original Message -
From: "Jay" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 22, 2005 2:00 AM
Subje
--- Lloyd Thomas <[EMAIL PROTECTED]> 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
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
, 2005 9:49 PM
Subject: [sqlite] tricky date time problem
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 w
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
21 matches
Mail list logo