Re: Using AVG

2005-05-18 Thread Dominicus Donny
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" Sent: Thursday, May 19, 2005 9:24 AM Subject: Using AVG Hello, when using the AVG function like this: SELECT A

Re: Using AVG

2005-05-18 Thread Mike Blezien
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

Re: Using AVG

2005-05-18 Thread Simon Garner
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 S

Using AVG

2005-05-18 Thread Mike Blezien
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! =-=-=-

Re: error when using avg( DISTINCT column)

2003-08-14 Thread Egor Egorov
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 when using avg( DISTINCT column)

2003-08-08 Thread mauri rogel
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.