Re: Known bug or just me? Take II

Re: Known bug or just me? Take II

am 23.07.2002 20:56:02 von Benjamin Pflugmann

Hi.

On Tue 2002-07-09 at 10:49:51 +0200, judy@neurotrax.com wrote:
> Hi all again,
>
> I've been experimenting and would like to know if there is a known bug in
> the std function when used with a group by clause?
> I'd like to know if others have found this problem or is it just me:
>
> I have a query without a groupby clause and the avg and std functions work
> fine.
> I add a group by clause on a field brought in from another table and the avg
> still works as expected but the std function returns all 0's.

Works fine for me:

mysql> SELECT VERSION();
+-------------+
| VERSION() |
+-------------+
| 3.23.49-log |
+-------------+
1 row in set (0.00 sec)

mysql> SELECT AVG(next_number), STD(next_number), RIGHT(gid,1) AS num
FROM guestbook GROUP BY num;
+------------------+------------------+-----+
| AVG(next_number) | STD(next_number) | num |
+------------------+------------------+-----+
| 51.3246 | 425.2162 | 0 |
| 52.2017 | 462.1029 | 1 |
| 49.1940 | 583.3506 | 2 |
| 48.7603 | 456.9280 | 3 |
| 47.1003 | 320.1228 | 4 |
| 48.7468 | 335.8219 | 5 |
| 50.0569 | 492.2443 | 6 |
| 48.5563 | 342.7715 | 7 |
| 49.7978 | 453.4491 | 8 |
| 54.5569 | 982.1618 | 9 |
+------------------+------------------+-----+
10 rows in set (2.32 sec)

Please try to provide a full test case which shows the problem.

> this does NOT:
> select count(Test1000.OID) as N,Language,
> avg(Accuracy) as AccAvg,std(Accuracy) as AccStd
> from Test1000,ROrders
> WHERE ROrders.OID=Test1000.OID
> Group by Language
> ----------------------------
> N Language AccAvg AccStd
> 521 1 91.4302 0.0000
> 24 2 87.3846 0.0000
>
> Any thoughts or referals would be greatly appreciated!
[...]

Greetings,

Benjamin.

--
benjamin-mysql@pflugmann.de

------------------------------------------------------------ ---------
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 bugs-thread12220@lists.mysql.com
To unsubscribe, e-mail