Hello,
when using the AVG function like this:
SELECT AVG((5+8+10)/3) AS rate;
it returns NULL??
the AVG can be used to do a literal math calculation ??
TIA
--
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
Mike Blezien wrote:
Hello,
when using the AVG function like this:
SELECT AVG((5+8+10)/3) AS rate;
it returns NULL??
the AVG can be used to do a literal math calculation ??
TIA
That doesn't make any sense... AVG is a GROUP BY function.
If you have 3 rows with values 5, 8 and 10 then surely
Simon Garner wrote:
Mike Blezien wrote:
Hello,
when using the AVG function like this:
SELECT AVG((5+8+10)/3) AS rate;
it returns NULL??
the AVG can be used to do a literal math calculation ??
TIA
That doesn't make any sense... AVG is a GROUP BY function.
If you have 3 rows with values 5, 8 and 10
Try this:
SELECT AVG((5+8+10)/3) AS rate FROM an_existing_table_name;
- Original Message -
From: Mike Blezien [EMAIL PROTECTED]
To: MySQL List mysql@lists.mysql.com
Sent: Thursday, May 19, 2005 9:24 AM
Subject: Using AVG
Hello,
when using the AVG function like this:
SELECT AVG((5+8+10
mauri rogel [EMAIL PROTECTED] wrote:
I'm getting a syntaxt error when using
select avg( DISTINCT column) from table.
the code above is from the teach urself sql book.
i have mandrake 9.1 linux. here's exactly what's
happening:
mysql select avg(distinct prod_price) from Products;
ERROR
I'm getting a syntaxt error when using
select avg( DISTINCT column) from table.
the code above is from the teach urself sql book.
i have mandrake 9.1 linux. here's exactly what's
happening:
mysql select avg(distinct prod_price) from Products;
ERROR 1064: You have an error in your SQL syntax.