mysql> Select count(id) from t_calllog_calls where id IS NULL;
+-----------+
| count(id) |
+-----------+
| 0 |
+-----------+
1 row in set (0.00 sec)
> -----Original Message-----
> From: mtoth [mailto:mtoth@stripped]
> Sent: Tuesday, September 17, 2002 12:39 PM
> To: Richard Unger
> Cc: mysql@stripped
> 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 me 1994 for all 3 columns of output.
> What I want to know is how many calls were longer than 5
> seconds, how many were <= 5 seconds, and the total number of calls.
> >
> > Cheers,
> > Rich
> >
> >
> > > -----Original Message-----
> > > From: Gelu Gogancea [mailto:ggelu@stripped]
> > > Sent: Tuesday, September 17, 2002 12:08 PM
> > > To: Richard Unger; mysql@stripped
> > > Subject: Re: aggregate functions producing bad data
> > >
> > >
> > > Hi,
> > > I think you should try to use 0 instead of NULL
> > >
> > > Regards,
> > >
> > > Gelu
> > > _____________________________________________________
> > > G.NET SOFTWARE COMPANY
> > >
> > > Permanent e-mail address : gg@stripped
> > > gelugogancea@stripped
> > > ----- Original Message -----
> > > From: "Richard Unger" <runger@stripped>
> > > To: <mysql@stripped>
> > > Sent: Tuesday, September 17, 2002 9:59 PM
> > > Subject: aggregate functions producing bad data
> > >
> > >
> > > 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
> > >
> > > However, 1956 + 35 != 1994.
> > >
> > > Running MySQL 3.23.49-nt
> > >
> > > Cheers,
> > > Rich
> > >
> > >
> ---------------------------------------------------------------------
> > > Before posting, please check:
> > > http://www.mysql.com/manual.php (the manual)
> > > http://lists.mysql.com/ (the list archive)
> > >
> > > To request this thread, e-mail
> <mysql-thread119848@stripped>
> > > To unsubscribe, e-mail
> > > <mysql-unsubscribe-ggelu=arctic.ro@stripped>
> > > Trouble unsubscribing? Try:
> http://lists.mysql.com/php/unsubscribe.php
> > >
> > >
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > Before posting, please check:
> > http://www.mysql.com/manual.php (the manual)
> > http://lists.mysql.com/ (the list archive)
> >
> > To request this thread, e-mail <mysql-thread119852@stripped>
> > To unsubscribe, e-mail
> <mysql-unsubscribe-mtoth=queldor.com@stripped>
> > Trouble unsubscribing? Try:
> http://lists.mysql.com/php/unsubscribe.php
> >
> >
>
>