re: Re: aggregate functions producing bad data

2002-09-18 Thread Victoria Reznichenko
Jay, Tuesday, September 17, 2002, 10:45:51 PM, you wrote: J> On my server the MySQL database decided to die on me. So I killed it and J> restarted and that didn't work. So I just rebooted the machine. Now I'm J> getting this error below. J> Invalid SQL: SELECT COUNT(*) AS messages FROM privat

RE: aggregate functions producing bad data

2002-09-18 Thread Gerben Gieling
Perhaps you should create a new table with an id column and a flag column. Select the found calls > 5 or <= 5 into that new table and set the flag. Then do a left join of your t_callog_calls table on the new table selecting only the rows where the flag is NULL, these should be the rows not found b

Re: aggregate functions producing bad data

2002-09-17 Thread Benjamin Pflugmann
Hi. Could you run the following query: SELECTIF(call_end - call_start > 5, id, NULL) AS long, IF(call_end - call_start <= 5, id, NULL) AS short, COUNT(*) FROM t_calllog_calls GROUP BY long, short Given that I have not made any mistake, that should list all rows whi

Re: aggregate functions producing bad data

2002-09-17 Thread mtoth
PROTECTED]> > To: "Richard Unger" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Tuesday, September 17, 2002 10:16 PM > Subject: Re: aggregate functions producing bad data > > > > On Tue, Sep 17, 2002 at 11:59:42AM -0700, Richard Unger wrote: > &

Re: aggregate functions producing bad data

2002-09-17 Thread Gelu Gogancea
[EMAIL PROTECTED] [EMAIL PROTECTED] - Original Message - From: "Brian Reichert" <[EMAIL PROTECTED]> To: "Richard Unger" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, September 17, 2002 10:16 PM Subject

Re: aggregate functions producing bad data

2002-09-17 Thread Gelu Gogancea
ROTECTED] - Original Message - From: "Brian Reichert" <[EMAIL PROTECTED]> To: "Richard Unger" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, September 17, 2002 10:16 PM Subject: Re: aggregate functions producing bad data > On Tue, Sep 17, 2002

Re: aggregate functions producing bad data

2002-09-17 Thread Jay
On my server the MySQL database decided to die on me. So I killed it and restarted and that didn't work. So I just rebooted the machine. Now I'm getting this error below. Invalid SQL: SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=1 mysql error: Can't open file: 'privatemessage.M

RE: aggregate functions producing bad data

2002-09-17 Thread Richard Unger
hard Unger > Cc: [EMAIL PROTECTED] > Subject: RE: aggregate functions producing bad data > > > what does > Select count(id) from t_calllog_calls where id IS NULL > give you? > > > On Tue, 17 Sep 2002, Richard Unger wrote: > > > That would just give m

RE: aggregate functions producing bad data

2002-09-17 Thread Richard Unger
> -Original Message- > From: Dan Nelson [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 17, 2002 12:31 PM > To: Brian Reichert > Cc: Richard Unger; [EMAIL PROTECTED] > Subject: Re: aggregate functions producing bad data > > > In the last episode (S

RE: aggregate functions producing bad data

2002-09-17 Thread mtoth
the total >number of calls. > > Cheers, > Rich > > > > -Original Message- > > From: Gelu Gogancea [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, September 17, 2002 12:08 PM > > To: Richard Unger; [EMAIL PROTECTED] > > Subject: Re: aggregate fun

Re: aggregate functions producing bad data

2002-09-17 Thread Dan Nelson
In the last episode (Sep 17), Brian Reichert said: > On Tue, Sep 17, 2002 at 11:59:42AM -0700, Richard Unger wrote: > > My query: > > > > SELECT > > count(id), > > count( IF(call_end - call_start > 5, id, NULL) ), > > count( IF(call_end - call_start <= 5, id, NULL) ) > > FROM > >

RE: aggregate functions producing bad data

2002-09-17 Thread Richard Unger
id is the primary key. There are no entries in the DB where id=NULL Cheers, Rich > -Original Message- > From: Brian Reichert [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 17, 2002 12:16 PM > To: Richard Unger > Cc: [EMAIL PROTECTED] > Subject: Re: aggregate f

RE: aggregate functions producing bad data

2002-09-17 Thread Richard Unger
ent: Tuesday, September 17, 2002 12:08 PM > To: Richard Unger; [EMAIL PROTECTED] > Subject: Re: aggregate functions producing bad data > > > Hi, > I think you should try to use 0 instead of NULL > > Regards, > > Gelu > _

RE: aggregate functions producing bad data

2002-09-17 Thread Richard Unger
I _thought_ it was the fault of the aggregate function, but now I'm really confused! When I produce them as 3 separate queries, I still get numbers that don't add up: mysql> select count(id) from t_calllog_calls; +---+ | count(id) | +---+ | 1994 | +---+ 1 row in set

Re: aggregate functions producing bad data

2002-09-17 Thread Gelu Gogancea
Hi, I think you should try to use 0 instead of NULL Regards, Gelu _ G.NET SOFTWARE COMPANY Permanent e-mail address : [EMAIL PROTECTED] [EMAIL PROTECTED] - Original Message - From: "Richard Un

Re: aggregate functions producing bad data

2002-09-17 Thread Brian Reichert
On Tue, Sep 17, 2002 at 11:59:42AM -0700, Richard Unger wrote: > My query: > > SELECT > count(id), > count( IF(call_end - call_start > 5, id, NULL) ), > count( IF(call_end - call_start <= 5, id, NULL) ) > FROM > t_calllog_calls; > > My result: > > 1994 > 1956 > 35 >