Link to home
Start Free TrialLog in
Avatar of deanparkr
deanparkr

asked on

Is it possible to do addition in SQL

Hi,

Quick Q as I cant find much in books / google. If I wanted to add two columns together how would I do that in SQL?

1 plus 1 = 2

Where 1 is is column 1,   the other 1 is column 2 and the answer  is in the "total" column.

If it is possible what would the syntax look like?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of deanparkr
deanparkr

ASKER

really?  that simple!  

Thanks!
What exactly you want to add?
SELECT ColA + ColB FROM YourTableI
f ColA and ColB are numaric, you will get the sum. If anyone of them is Alpha-Numaric, it will concatinate both columns. Do you want the numaric data also to be concatinated? like 10 and 20 to be as 1020