by either query.
Inspect the data in these rows manually to determine what is wrong.
-Original Message-
From: Richard Unger [mailto:[EMAIL PROTECTED]]
Sent: September 17, 2002 21:00
To: [EMAIL PROTECTED]
Subject: aggregate functions producing bad data
My query:
SELECT
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
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
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
However, 1956
Unger [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
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
) |
+---+
|35 |
+---+
-Original Message-
From: Richard Unger
Sent: Tuesday, September 17, 2002 12:00 PM
To: '[EMAIL PROTECTED]'
Subject: aggregate functions producing bad data
My query:
SELECT
count(id),
count( IF(call_end - call_start 5, id, NULL
, 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
_
G.NET SOFTWARE COMPANY
Permanent e-mail address
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 functions producing bad
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
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 functions producing bad data
Hi,
I think you should try to use 0 instead
-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 (Sep 17), Brian Reichert said:
On Tue, Sep
: [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 me 1994 for all 3 columns of output.
What I want to know is how many calls
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:
]
- 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 at 11:59:42AM -0700, Richard Unger wrote:
My query:
SELECT
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
On Tue, Sep
, 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:
My query:
SELECT
count(id),
count( IF(call_end - call_start 5, id, NULL) ),
count( IF(call_end - call_start = 5, id, NULL) )
FROM
MySQL -- to defeat the spam filter
-Original Message-
From: Richard Unger
Sent: Tuesday, September 17, 2002 1:46 PM
To: 'Dan Nelson'
Cc: [EMAIL PROTECTED]
Subject: RE: aggregate functions producing bad data
Thanks, I figured it out. It turns out there were some calls for which
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
18 matches
Mail list logo