Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Summing columns in a row
Mon, Oct 26 2009 9:03 AMPermanent Link

Rob
Hello.

I think I know the answer to this, but is it possible using SQL to sum a number of columns in each row to a Totals column?

At present I'm skipping through the resords to do it.

Thanks.
Mon, Oct 26 2009 9:35 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Rob


Assuming you know which columns you want it should be possible something like

select _Sequence, _Order, (_Sequence +_Order) AS CrossTotal from billing

or to give the totals

select SUM(_Sequence), SUM(_Order), SUM((_Sequence +_Order)) AS CrossTotal from billing


Roy Lambert [Team Elevate]
Image