0
SQL: The SUM of Multiple Columns
Explorer
,
/t5/dreamweaver-discussions/sql-the-sum-of-multiple-columns/td-p/438899
Oct 17, 2007
Oct 17, 2007
Copy link to clipboard
Copied
Can someone please tell me how to SUM mulitple columns using
SQL.
I know that this will sum 2 columns:
SELECT
SUM(billing.space_cost) + SUM(billing.pub_box)
FROM billing
and thought that this would do more, but it does not seem to work:
SELECT
(SUM(billing.space_cost) + SUM(billing.pub_box) + SUM(billing.messenger))
FROM billing
Anyone know this one?
I know that this will sum 2 columns:
SELECT
SUM(billing.space_cost) + SUM(billing.pub_box)
FROM billing
and thought that this would do more, but it does not seem to work:
SELECT
(SUM(billing.space_cost) + SUM(billing.pub_box) + SUM(billing.messenger))
FROM billing
Anyone know this one?
TOPICS
Server side applications
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/dreamweaver-discussions/sql-the-sum-of-multiple-columns/m-p/438900#M168984
Oct 18, 2007
Oct 18, 2007
Copy link to clipboard
Copied
This should work fine. The syntax you provide will certainly
SUM these 3
columns ok, providing they are numeric.
Pat.
"VernMan" <webforumsuser@macromedia.com> wrote in message
news:ff5cc5$n8h$1@forums.macromedia.com...
> Can someone please tell me how to SUM mulitple columns using SQL.
>
> I know that this will sum 2 columns:
>
> SELECT
> SUM(billing.space_cost) + SUM(billing.pub_box)
> FROM billing
>
> and thought that this would do more, but it does not seem to work:
>
> SELECT
> (SUM(billing.space_cost) + SUM(billing.pub_box) + SUM(billing.messenger))
> FROM billing
>
> Anyone know this one?
>
columns ok, providing they are numeric.
Pat.
"VernMan" <webforumsuser@macromedia.com> wrote in message
news:ff5cc5$n8h$1@forums.macromedia.com...
> Can someone please tell me how to SUM mulitple columns using SQL.
>
> I know that this will sum 2 columns:
>
> SELECT
> SUM(billing.space_cost) + SUM(billing.pub_box)
> FROM billing
>
> and thought that this would do more, but it does not seem to work:
>
> SELECT
> (SUM(billing.space_cost) + SUM(billing.pub_box) + SUM(billing.messenger))
> FROM billing
>
> Anyone know this one?
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

