-5

I have the following data below:

column 1 | column 2 
23       | 25      

I would like query the data in such a was as to have the following results:

column 1 | column 2 | total 
23       | 25       | (column 1 + column 2)

How can I achieve this?

2
  • 1
    What is your question?
    – RLF
    Commented Sep 23, 2015 at 13:50
  • SUM(val1+val2) AS Total (?)
    – Nelson
    Commented Sep 23, 2015 at 13:52

1 Answer 1

2

Try this:

SELECT val1 + val2 AS sum FROM table

If you will select the two original columns and the sum:

SELECT val1, val2, val1 + val2 AS sum FROM table

Not the answer you're looking for? Browse other questions tagged or ask your own question.