Sum of a summation in mysql
Posted
by
dames
on Stack Overflow
See other posts from Stack Overflow
or by dames
Published on 2012-04-13T17:06:38Z
Indexed on
2012/04/13
17:28 UTC
Read the original article
Hit count: 152
I have the following query, in the top select statement (sum(l.app_ln_amnt)/count(l.app_ln_amnt))
works well but in the union I want to find the total of (sum(l.app_ln_amnt)/count(l.app_ln_amnt))
query from the top select statement However my solution seems to be off I need some help please
select
(sum(l.app_ln_amnt)/count(l.app_ln_amnt)),
from receipt_history l
UNION
select
SUM(sum(l.app_ln_amnt)/count(l.app_ln_amnt)),
from receipt_history l
© Stack Overflow or respective owner