Select avg(id1) from <tableName> where id1 is not null; ?
----- Original Message -----
From: "Graeme B. Davis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 22, 2001 11:29 AM
Subject: Average of all NON-NULL columns in a ROW?
> Is there a way to get the AVG of all specified NON-NULL columns in one
row?
> Right now I am doing this in a little script, but it would be nice if I
> could do something like this:
>
> DATA
> ---------
> id1 0 4 4 NULL 3 NULL
>
> I want the average of 0,4,4,3 ie (0+4+4+3)/4
>
> is there a way to do this in a SELECT query?
>
> Thanks!
>
> Graeme
>
>
> ---------------------------------------------------------------------
> 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 <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> 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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php