I know this is not elegant, but have have you tried using a temporary table? It adds up your function column correctly. There was an example of this earlier today from Oyekanmi - "Re: getting around a subselect",
http://lists.mysql.com/cgi-ez/ezmlm-cgi?1:mss:123911:200211:onbajmklkgifeckohcpa

Try
create temporary table temp <your query here>;
select sum(cell),sum(sector),sum(att), sum(etc) from temp;

John

Black, Kelly W [PCS] wrote:
Hi sql query wizards!

I need some help.

Is there a way I can take this query here =>

mysql> SELECT cell, sector,
    -> sum(att) as att,
    -> sum(lc) as lc,
    -> sum(csh) as csh,
    -> ROUND((SUM( lc + csh ) * 100 ) / (SUM(att) - SUM(tccf + bpp + bpc +
suf)),2) AS drops,
    -> sum(tccf) as tccf,
    -> sum(bpp) as bpp,
    -> sum(bpc) as bpc,
    -> sum(suf) as suf,
    -> ROUND(SUM( tccf + bpp + bpc + suf) *100 / SUM(att),2) AS blocks,
    -> sum(mou) as mou
    -> FROM ss
    -> WHERE release=CURDATE()
    -> GROUP BY cell
    -> HAVING sector=1 AND (cell=148 or cell=3);
+------+--------+------+------+------+-------+------+------+------+------+--
------+------+
| cell | sector | att  | lc   | csh  | drops | tccf | bpp  | bpc  | suf  |
blocks | mou  |
+------+--------+------+------+------+-------+------+------+------+------+--
------+------+
|    3 |      1 |  734 |   12 |    6 |  2.52 |   21 |    0 |    0 |    0 |
2.86 | 1501 |
|  148 |      1 | 2746 |   93 |   30 |  4.59 |   63 |    0 |    0 |    1 |
2.33 | 4672 |
+------+--------+------+------+------+-------+------+------+------+------+--
------+------+

And have it display the two rows as a total sum together in one row?

I have been struggling with this and could really use some help.
Thanks in advance for any ideas.....

Regards,

Kelly Black


Linux was very clearly the answer, but what was the question again?


---------------------------------------------------------------------
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

Reply via email to